Here is my need: I have a table categories of a forum application. I need a variable that I can use in my app/views/layouts/application.html.erb so I can create a dropdown in the navbar with all categories in all the pages.
There's just one way I saw this as possible but as I am new to Rails I don't think it is the best, that is creating a $categories = Category.all. But as I said, it looks dangerous.
What would the best way to solve my problem?