I have a list posts, which when clicked on should show the url
as posts/this+is+the+title
.
After doing this, how would I catch this in the controller to fetch data from the database?
<% @posts.each do |fq| %>
<%= link_to fq.title,fq%>
<p><%= fq.content %></p>
<hr />
<% end %>
Assuming a title is "Ruby on Rails" with id =3 The above code, generates a url like this 'localhost:3000/posts/3'. But I would want the link to be 'localhost:3000/posts/ruby+on+rails'