So I have a layout (application.rhtml) that contains a list of categories that are stored within the database. To get retrieve the list I overwrite the initialize method within the application controller (application.rb) as such:
def initialize @categories = Category.find(:all, :order => :position) end
Is this the best way I should be doing this? I don't want to have this code in my layout breaking MVC idioms, but is there a more preferred way in best practice then by doing it this way?