ActionController::MethodNotAllowed

Posted by Lowgain on Stack Overflow See other posts from Stack Overflow or by Lowgain
Published on 2010-04-29T20:13:26Z Indexed on 2010/04/29 20:17 UTC
Read the original article Hit count: 475

Filed under:
|

I have a rails model called 'audioclip'. I orginally created a scaffold with a 'new' action, which I replaced with 'new_record' and 'new_upload', becasue there are two ways to attach audio to this model.

Going to /audioclips/new_record doesn't work because it takes 'new_record' as if it was an id. Instead of changing this, I was trying to just create '/record_clip' and '/upload_clip' paths.

So in my routes.db I have:

map.record_clip '/record_clip', :controller => 'audioclips', :action => 'new_record'
map.upload_clip '/upload_clip', :controller => 'audioclips', :action => 'new_upload'

When I navigate to /record_clip, I get

ActionController::MethodNotAllowed
Only get, head, post, put, and delete requests are allowed.

I'm not extremely familiar with the inner-workings of routing yet. What is the problem here? (If it helps, I have these two statements above map.resources => :audioclips

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about routes