Forum: Ruby on Rails Restful Polymorphic Post Path

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
steve odom (Guest)
on 2007-06-23 03:30
(Received via mailing list)

I'm trying to create a link_to_remote whereby it takes me to the
CREATE action of a polymorphic model (points). Ex:

<%= link_to_remote "up", :url => comment_points_path(item), :method
=> :post %>

That takes me to the show action in the points controller instead of

The routing looks something like:
  map.resources :comments do |comment|
    comment.resources :points, :name_prefix => 'comment_'
  map.resources :articles do |article|
    article.resources :points, :name_prefix => 'article_'


Can I do this using a restful route or will I have to do it long hand
(:url => {:controller => "points", :action => "create", :comment_id => }? I figure I've got something slightly off.


steve odom (Guest)
on 2007-06-23 15:58
(Received via mailing list)
Seems to be working now!
This topic is locked and can not be replied to.