Well, how are you currently going about it? Is Club.find_all not working?
Jason
Well, how are you currently going about it? Is Club.find_all not working?
Jason
Looks like you’re still not quite grasping what Controller classes are. def club; … end; is an action, code that will only be called when you POST/GET to /users/club. Looks like you want just /users/, so your index action (def index; … end;) is the one that should contain @club = Club.find_all.
Of course, the view is wrong as well.
Controller:
def index @user = [user stuff] @clubs = Club.find_all end
View:
<% for club in @clubs %> <%= club.id %> <%= club.name %> <% end %>
You should spend some more time looking through documentation on how to use Rails. The Agile Development with Rails is an excellent book to get you started.
Jason