# Restful Polymorphic Post Path

**URL:** <https://www.ruby-forum.com/t/restful-polymorphic-post-path/107553>\
**Category:** Rails\
**Created:** [June 23, 2007, 1:30am UTC](https://www.ruby-forum.com/t/restful-polymorphic-post-path/107553 "2007-06-23T01:30:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_odom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@steve\_odom](https://www.ruby-forum.com/u/steve_odom)\
**Post date:** [June 23, 2007, 1:30am UTC](https://www.ruby-forum.com/t/restful-polymorphic-post-path/107553/1 "2007-06-23T01:30:51Z")

</div>

Hi,

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  
create.

## The routing looks something like:

map.resources :comments do |comment|  
comment.resources :points, :name\_prefix =\> ‘comment\_’  
end  
map.resources :articles do |article|  
article.resources :points, :name\_prefix =\> ‘article\_’  
end

* * *

Can I do this using a restful route or will I have to do it long hand  
(:url =\> {:controller =\> “points”, :action =\> “create”, :comment\_id =\>  
item.id }? I figure I’ve got something slightly off.

Thanks,

Steve

---

<div class="post-metadata">

**Author:** ![steve\_odom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@steve\_odom](https://www.ruby-forum.com/u/steve_odom)\
**Post date:** [June 23, 2007, 1:58pm UTC](https://www.ruby-forum.com/t/restful-polymorphic-post-path/107553/2 "2007-06-23T13:58:50Z")

</div>

Seems to be working now!
