ruby on rails - Menu displayed on all pages, code is replicated in all controllers -


i have collection model. succesfully created _collection.html.erb call <%= render @collections%> in application layout.

my problem in controlers method must add @collections = collection.all

i found very ugly,it make collection scope pain change, , i'm sure missing rails magic way nicer.

is there way have part of layout generated model data without having identical piece of code in aaaallllll controllers?

notice controllers inherit applicationcontroller. use advantage. add before_filter applicationcontroller loads collections.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -