Leonel *.* wrote in post #955167: > Currently, I have this on the application controller... > def company_name > User.find_by_id(session[:user_id]).account.name > end > > So then in each controller I have to add this, which is not very DRY. > The @company_id needs to be used in almost every page and it's accessed > on the application.html.erb on a link > @company_id = company_id (has to be added to EVERY CONTROLLER) > > How can I NOT have to add the above line in every controller? Is there a > way to add it to the application controller and have it available to > application.html.erb regardless on what page im on?
You asked a nearly identical question a few days ago. Please read http://groups.google.com/group/rubyonrails-talk/msg/c8a1cc193e362316 again, where I answered this exact question. 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-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.