I am new to Ruby on Rails, and I am not confident about my MVC logic.
I am proceeding in this way:
- I have a model 'User'
- In my controller, I set an instance variable called
@users = User.all
- In my views, I implement my logic like this :
<%= @users.each ... %>
I was asking myself in I could bypass the controller step and write this in my views : <%= User.all.each ... %>
I'd like to use good practices in my project, is the second way acceptable?