Reputation: 1086
What's the best method for removing certain params from a url? For example I'm looking to change:
www.testsite.com/blog?blog_id=1582
to
www.testsite.com/blog/1582
<%= link_to list.blog_name, blog_blogs_path(blog_id: list.blog_id) %>
Upvotes: 0
Views: 509
Reputation: 1488
make the link a variable and then carry out a string substitution
myString.gsub("?blod_id=", "/")
Upvotes: 0
Reputation: 791
Example:
<%= link_to list.blog_name, blog_blog_path(list.blog_id) %>
Note the path is now: blog_blog_path (no s)
Upvotes: 1