Reputation: 1165
I did not generate the complete user model and i do not know how i can link to the user profile. I have tried:
<%= link_to u.username, user_show_path(u) %>
However it only shows an error, if it's any difference I am also using the devise gem
Upvotes: 0
Views: 64
Reputation: 1165
Sorted, used the link
link_to u.username, :controller => "users", :action => "show", :id => u
and then wrote a simple route,
match "/user/:id" => "users#show"
Upvotes: 0
Reputation: 481
There are many ways link_to can be used
link_to u.username, user_path(u)
link_to u.username, u
link_to u.username, :controller => "users", :action => "show", :id => u
all should work, the issue could be that you are using user_show_path
Upvotes: 1