I am currently learning ruby on rails with 3.0
I have created a post table with a column called friendly
Instead of using /post/:id I want to use /post/:friendly
meaning a URL will look like /post/post-title instead of /post/1
I have the controller framed properly with this code.
def show
@post = Post.find(params[:friendly])
respond_to do |format|
format.html
format.json { render :json => @post }
end
end
But I am not sure how to change routes.rb to implement this change.
Right now it just says
resources :post
Thanks in advance for your help.