I have some associations that is connected to the user
User model
has_many :lists
has_many :ideas
How do I display the lists and ideas in the user's page?
In my users controller, show method
def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @user }
end
end
In my show.html.erb
I can only display user name, i.e.:
<%= @user.username %>
I'm trying to see what I need to put in the show action so I can do something like
@user.lists.name
, or @user.ideas.name
I'm new to rails still and I'm trying to understand how to link everything together with user?
Hopefully this is enough information?
Thanks