Hi, i''m building a blogging engine and it has a settings panel where
the
user set the blogs url, title, how many posts to display, how many in a
feed, etc.
These settings are stored in a table, in one record, which i''ve got in
the
Now to have those settings available to all the controllers / helpers /
etc. i''ve got this defined in the Application Controller...
class ApplicationController < ActionController::Base
before_filter :myconstants
def myconstants
@settings = Settings.find(:first)
end
end
that''s all fine but is there any way i could do this better ?
appreciate any insight on this,
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---