# Question about RESTful resource routing

**URL:** <https://www.ruby-forum.com/t/question-about-restful-resource-routing/110906>\
**Category:** Rails\
**Created:** [July 31, 2007, 11:24pm UTC](https://www.ruby-forum.com/t/question-about-restful-resource-routing/110906 "2007-07-31T23:24:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Post date:** [July 31, 2007, 11:24pm UTC](https://www.ruby-forum.com/t/question-about-restful-resource-routing/110906/1 "2007-07-31T23:24:45Z")

</div>

Hi guys. I’ve got a tree of Nodes which I’d like to edit via a RESTful  
controller. The wrinkle at the moment is enabling manual ordering of the  
nodes - that is to say, given a node, I want the user to be able to  
reorder its children.

routes.rb:

map.resources :nodes, :member=\>{:order=\>:put}

edit.rhtml:

 \<% @node.children.each do |child| %\> - \<%=h child.name%\>
 \<% end %\>
\<%= sortable\_element('list', :url=\>order\_node\_url(@node)) %\>

nodes\_controller.rb:

def order

# reorder the nodes

end

Unfortunately, dragging nodes in the list issues a POST request, which  
rails rightfully rejects as improper for the order\_node\_url. I could fix  
this by changing routes.rb to map :order to :post, but I believe that’s  
improper semantics.

What should I do in order to correct this? I would have thought the  
order\_node\_url helper would automatically generate a PUT request.

- donald
