Friendly_ID Ruby on Rails
问题 The URL still shows the id and not the title even after using slug. Code as follows index.html.erb <title>Blog!</title> <h1>List of the Posts</h1> <% @posts.each do |post| %> <%= link_to post.title,:id => post.slug%> <p><%= post.content %></p> <%= link_to "Edit",edit_post_path(post) %> | <%= link_to "Delete",post,:confirm=>"Are you sure ?",:method=>:delete %> <hr /> <% end %> <p><%= link_to "Add a New Post",new_post_path %></p> posts_controller.rb class PostsController < ApplicationController