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?

-- 
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.

Reply via email to