Link_to doesn't work when using acts-as-taggable-on with custom method
Or rather I don't know how to specify the route for it.
I have my controller setup us:
def tags
@clients = current_user.clients.find_tagged_with(params[:开发者_StackOverflowtag])
end
and my views
Tags:
<% for tag in @client.tags %>
<%= link_to tag.name, clients_path(:view =>'tag', :tag => tag.name) %>
<% end %>
Only problem is that the link (clients_path) goes back to index and not 'all.' I know it has to do with changing the clients_path to somehow tell it to use 'all'. But I don't know how.
Any help?
Thanks
You can check your routes using rake routes
.
I'm not sure what you mean by 'all' but if this is a custom method added to routes, then you should be able to use all_clients_path
instead of clients_path
.
精彩评论