# Routing error

**URL:** <https://discuss.rubyonrails.org/t/routing-error/32065>\
**Category:** rubyonrails-talk\
**Created:** [July 19, 2008, 2:56am UTC](https://discuss.rubyonrails.org/t/routing-error/32065 "2008-07-19T02:56:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joel1](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@joel1](https://discuss.rubyonrails.org/u/joel1)\
**Post date:** [July 19, 2008, 2:56am UTC](https://discuss.rubyonrails.org/t/routing-error/32065/1 "2008-07-19T02:56:35Z")

</div>

Hello All,

I'm trying to implement a new method action in my controoller to which I ll make an ajax call. So my routes go like this :

&nbsp;&nbsp;map.resources :photos, &nbsp;&nbsp;:collection =\> { &nbsp;&nbsp;&nbsp;&nbsp;:increment\_downloads =\> :post &nbsp;&nbsp;} but on my ajax call, I m still getting a 405 error : 405 Method Not Allowed

my js ajax call goes like this :

var myAjax = new Ajax.Request('/photos/increment\_downloads/',{method: 'get', parameters:params })

Can anyone help with this issue.

Thanks,

Joel

---

<div class="post-metadata">

**Author:** ![Nasir\_Jamal](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@Nasir\_Jamal](https://discuss.rubyonrails.org/u/Nasir_Jamal)\
**Post date:** [July 19, 2008, 11:34pm UTC](https://discuss.rubyonrails.org/t/routing-error/32065/2 "2008-07-19T23:34:49Z")

</div>

You are getting this method not allowed error because in your ajax call you are using http method get but in the routes you are using post.

Make both of them post or in your routes, change :increment\_downloads =\> :post to :increment\_downloads =\> :any

Cheers
