Älphä Blüë wrote:
> I will have roughly 37 models 

Really?  That's a lot of models -- I wonder whether it's necessary to 
have so many.  (If your data is complex, perhaps it is necessary.)

> that will contain this piece of code
> (although it will be further modified):

[...]
> The question I have is how can I simplify this by creating a
> global/helper class that can be used in the other 37 pages.
[...]

Sure.  Put the code in a module that gets included in all the models, or 
subclass ActiveRecord::Base.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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-talk@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