On 18 March 2010 13:53, ES <emsto...@gmail.com> wrote:
> yes I am going through create, should I make the @columns hash a class
> variable or just repopulate it in the create method?

You can do it however you like; you just need to make sure it's not nil ;-)

Personally... I would make a decision based on the object and the purpose:
 - I *doubt* it's really likely to be best as a class variable
 - repopulate it if that's easiest, but consider refactoring the
population out to a private method to reuse it
 - Could it be that this variable may really make more sense as a constant?
 - Maybe other factors come into play that aren't evident from your posting...

To be honest... I'm not sure I like the idea of the controller telling
the view which fields to display - maybe this functionality would be
better off in a view helper - but that's a different conversation, and
it's your code :-/

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to