# Nested Resources cause MethodNotAllowed error

**URL:** <https://www.ruby-forum.com/t/nested-resources-cause-methodnotallowed-error/158518>\
**Category:** Rails\
**Created:** [January 24, 2009, 6:25am UTC](https://www.ruby-forum.com/t/nested-resources-cause-methodnotallowed-error/158518 "2009-01-24T06:25:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSSBMpKSSzE5SSB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/57b2e6/32.png) [@SSSBMpKSSzE5SSB](https://www.ruby-forum.com/u/SSSBMpKSSzE5SSB)\
**Post date:** [January 24, 2009, 6:25am UTC](https://www.ruby-forum.com/t/nested-resources-cause-methodnotallowed-error/158518/1 "2009-01-24T06:25:34Z")

</div>

I want to make every line in a doc in-place-editable.  
rails 2.2.2

routes.rb  
map.resources :docs do |poem|  
poem.resources :lines  
end

view-server-side  
new Ajax.InPlaceEditor(‘line\<%=line\_number +1%\>’, ‘\<%= doc\_line\_path  
(:doc\_id =\> @doc.id,:id =\> line\_number) %\>’);

view-client-side  
new Ajax.InPlaceEditor(‘line5’, ‘/docs/4/lines/4’);

log  
ActionController::MethodNotAllowed (Only get, put, and delete requests  
are allowed.)

if i change the doc\_line\_path to doc\_lines\_path  
view-client-side  
new Ajax.InPlaceEditor(‘line5’, ‘/docs/4/lines?id=4’)

log  
Processing LinesController#create (for 127.0.0.1 at 2009-01-24  
13:10:52) [POST]

what i want is LinesController#update.  
why the url ‘/docs/4/lines/4’ can not be mapped to the “update”  
action of LinesControlelr?  
Is it a defact of rails2.2.2?  
waiting for you help.
