Hi,

I have quetion about 'named route'.

I defined the following in routes.rb to use ':title' instead of ':id'.

  map.movie '/
movies/:title', :controller=>'movies', :action=>'show', 
:conditions=>{:method=>:get}

This seems to work fine, but 'movie_path()' still uses ':id' instead
of ':title'.

  movie = Movie.get(parms[:id])
  p movie_path(movie)   #=> "/movies/1" (expected is "/movies/Avatar")

How to change 'movie_path()' to use ':title'?

--
regards,
makoto

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to