(FYI: I first posted this question at StackOverflow a couple of days ago
without any luck.)
I am developing a new web application in Rails 3.2. I have come to the
point where I am trying to make everything look as nice in IE as
Firefox/Chrome etc.
For that I am using CSS3 PIE http://css3pie.com/
I have a site with a lot of view code like this:
p
%...@post.user.name%
/p
Unfortunately a lot of old posts have had their users deleted, so the
code above breaks the entire view. I am working on a larger cleanup on
the code, but in the meantime I would like to make a quickfix to get the
views
Michael Pavling wrote:
Does that make sense?
It does make sense, and this is a process that I am currently working
through. My example was just a single extract from the application,
though, and there are many of these scattered all over the code.
So what I really wants is a quick-fix that
Michael Pavling wrote:
Overloading method_missing is probable to cause more problems than it
fixes :-)
I know - it is a very VERY temporary solution to get peace to do real
fixing. :-)
You only need to fix the missing associations one at a time; get a
MissingUser in there and all the nil
While redesigning an existing application, I've stumbled on a problem.
A number of links on the site requires that the user logs in. This is
currently solved by the simple (example)
%=link_to 'Upload image', :controller = 'image', :action = 'new' %
and in the ImageController I place a
Andy Jeffries wrote:
OK, so I had a bit more of a play. You'll still need to do this:
This (and the previous reply) is exactly what I needed! Thanks a bunch
:-)
You will probably want to wrap that up in to a method somewhere neater
and
you'd need to consider that the user may already be
I have a site, where I am currently adding a self-built shop.
Among other stuff I have this construction in my route-file
map.namespace :shop do |shop|
shop.resources :categories do |categories|
categories.resources :products
end
end
I like the namespace, since it encapsulates the shop
I am implementing a system for users to easily create a small shop for
themselves. And I've run into a route problem.
NOTE: I've removed a lot from my route.rb file, since I want focus on
this particular problem. :-)
I currently have a route.rb like this:
ActionController::Routing::Routes.draw
My head is spinning a bit this morning - can somebody help me with this?
Given these two models with the following associations:
class Article ActiveRecord::Base
belongs_to :category
- has an attribute called published_on
end
class Category ActiveRecord::Base
has_many :articles
end
Gavin Morrice wrote:
Off the top of my head, try:
Category.all :include = :articles, :order = articles.published_on
DESC
Works like a charm - thanks!
Now that you got my head pointed in the right direction ;-) I noticed,
that :joins does the same job for me (ie. same result) with some
Marnen:
you have one application, accessible through multiple channels.
Keep it that way -- since it's one application
Andrew:
One issue with splitting the application into 3 will be
consistency of deployment
You could add something like app/importers and app/exporters
and treat them like
I allow myself to bump this question just once, since I believe, that it
is quite relevant at the moment, considering the release of Rails 2.3
- Carsten
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are
Tushar Gandhi wrote:
I have one more question
Is it possible to create table structure into it?
If yes how to do that?
Is there any documentation available for the rpdf?
You will find all you need here:
http://ruby-pdf.rubyforge.org/pdf-writer/
- Carsten
--
Posted via
Maurício Linhares wrote:
Solr is a full blown full text search tool with most of the features
you'll see in enterprise tools like fuzzy searching (that enables
...
I will give Solr a go, thanks. One of the things I like about
ThinkingSphinx though is the ability to combine Sphinx's free-text
Can anyone recommend a search engine for Rails that works with MS SQL
Server?
I have good experience in using Sphinx and the Rails plugin UltraSphinx.
Unfortunately, it supports only MySQL and PostgreSQL. The newest beta
version does add support for MSSQLServer, but only if Sphinx is
installed
Peter De Berdt wrote:
Gruff (http://rubyforge.org/projects/gruff/) or Scruffy
(http://scruffy.rubyforge.org/
Thanks a lot! I am working with Scruffy now, and it works like a charm.
:-)
One thing I cannot figure out though is: How do I change the legend from
horizontal to vertical? Do I
Does any of you know of a good server-side tool for generating
line-charts - command-line tool will suffice (one that spits out a JPG,
SVG, PNG or such)
Something integrated in Ruby would be even nicer :-)
- Carsten
--
Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:
Two thoughts:
1. Use composed_of to make the process of String conversion completely
transparent.
Yeah good idea.
2. Try a REE-specific forum for more help.
Already did that - in the Passenger google group. Though I was in doubt
if this was a Rails/AR/MySQL
*sigh*
I found only one solution: I converted all my decimal fields in the DB
to varchar, and rewrote my code to make sure the value was converted
to BigDecimal before used in calculations.
- Carsten
--
Posted via http://www.ruby-forum.com/.
I have a strange problem with my setup of Passenger and Ruby Enterprise
Edition.
Sometimes the loading of BigDecimals from the database and session fails
(silently) and the variable containing the BigDecimal is just empty.
I cannot pinpoint where/when/how it happens, and it IS only periodic.
I
Small discovery:
1) The problem begins after the application has run for a period of
time, e.g ½ hour.
2) If I do a touch tmp/restart.txt the problem disappears - only to
resurface again later
So I think something is bottling up inside the application. When it
happens, it concerns ALL
Andrew Timberlake wrote:
I don't get that error using Edge Rails
Whoops - should have tried that first... Sorry :-) And thanks.
- Carsten
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Let's say, that I need the gem pdf-writer for a rails project. And I
define it inside environment.rb and run rake gems:unpack
No problem there, pdf-writer is installed into vender/gems.
But pdf-writer itself depends on some other gems like color and
transaction-simple. AND color depends on
I will allow myself to bump this question just once, since I think it is
important - it really seems like a bug, but I would like to know, if
anyone else has experienced this before submitting to the bug list.
- Carsten
Carsten Gehling wrote:
I've discovered a strange behavior regarding
I've discovered a strange behavior regarding ActiveRecord and
TimeWithZone
I've seen the error when using SQL Server, I have not yet tried with any
other database.
Here's output from the console - User is a simple model made with a
migration.
-
d1 =
BMorearty wrote:
I think InstantRails is actually a great way to install Ruby and Rails
on a Windows machine, even though it hasn't been updated since the end
of 2007. I still use it for Rails development on Windows. You can use
it to install a working Rails 2.0 system and then upgrade to
I have a Rails application, that has grown quite large. At the moment
all texts are placed inside the template files like this:
h3This is a header/h3
And inside the ruby code (like flash messages, model error messages,
etc.)
I now have the situation, that I want to place all text in an
squashua wrote:
Hi,
I'm a newbie who's tried over a half dozen times now to install the
full Ruby and All-in-One RoR app for my Windows XP machine.
...
Since you are on Windwos, have you tried InstantRails?
http://instantrails.rubyforge.org/wiki/wiki.pl
InstantRails is brilliant, as it
28 matches
Mail list logo