I'm studying how to use simple_form gem at index.html.erb from my user's folder. I have no success. The weird thing is that it is working at _form.html.erb. Why?
users_controller.rb
def index
@users = User.find_by_sql(["SELECT id, name, login, password
FROM users"])
end
users/index.html.erb
<%= simple_form_for @users do |f| %>
<p>
<%= f.input :name %>
</p>
.
.
.
<p>
<%= f.button :submit %>
</p>
<% end %
It is raising this exception: undefined method `model_name' for NilClass:Class
Any ideas?