# Routes and RJS

**URL:** <https://www.ruby-forum.com/t/routes-and-rjs/173577>\
**Category:** Rails\
**Created:** [August 11, 2009, 5:20pm UTC](https://www.ruby-forum.com/t/routes-and-rjs/173577 "2009-08-11T17:20:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmckinstry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f6c823/32.png) [@pmckinstry](https://www.ruby-forum.com/u/pmckinstry)\
**Post date:** [August 11, 2009, 5:20pm UTC](https://www.ruby-forum.com/t/routes-and-rjs/173577/1 "2009-08-11T17:20:52Z")

</div>

Hi Folks,

Sorry to ask more questions 🙂

So I gave a RJS a go, I have a simple countries ‘index’ which lists  
countries and with alink to ‘show’ which shows detail.

It works fine when you go to

/countries/AD in a browser

However the same request via Ajax and RJS (I am checking the http  
headers) which is a POST I get the error

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

So what do I need to do to get my routing working with RJS?

Thanks Again!

---

<div class="post-metadata">

**Author:** ![pmckinstry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f6c823/32.png) [@pmckinstry](https://www.ruby-forum.com/u/pmckinstry)\
**Post date:** [August 11, 2009, 6:26pm UTC](https://www.ruby-forum.com/t/routes-and-rjs/173577/2 "2009-08-11T18:26:24Z")

</div>

Hi Pete,

On Tue, 2009-08-11 at 17:20 +0200, Pete M. wrote:

> Hi Folks,
> 
> Sorry to ask more questions 🙂
> 
> So I gave a RJS a go, I have a simple countries ‘index’ which lists  
> countries and with alink to ‘show’ which shows detail.

Assuming you’re using link\_to\_remote, you can change the HTTP verb using  
the :method option. See the docs ([api.rubyonrails.org](http://api.rubyonrails.org)) for examples.

HTH,  
Bill

> It works fine when you go to
> 
> /countries/AD in a browser
> 
> However the same request via Ajax and RJS (I am checking the http  
> headers) which is a POST I get the error
> 
> ActionController::MethodNotAllowed (Only get, put, and delete requests  
> are allowed.)
