# Http method for link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/http-method-for-link-to-remote/141946>\
**Category:** Rails\
**Created:** [July 1, 2008, 11:55pm UTC](https://www.ruby-forum.com/t/http-method-for-link-to-remote/141946 "2008-07-01T23:55:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markmt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/df705f/32.png) [@markmt](https://www.ruby-forum.com/u/markmt)\
**Post date:** [July 1, 2008, 11:55pm UTC](https://www.ruby-forum.com/t/http-method-for-link-to-remote/141946/1 "2008-07-01T23:55:00Z")

</div>

Hi, I have two nested resources in routes.rb -

* * *

## map.resources :subscriptions do |subscription| subscription.resources :users end

and I’m using link\_to\_remote to create a new “user” as follows -

* * *

## \<%= link\_to\_remote “New User”, {:url =\> new\_subscription\_user\_url(@subscription), :method =\> “get”) %\>

In the process of doing this I discovered that the default request  
method for link\_to\_remote is POST, and so this didn’t work until I  
added the :method =\> “get” parameter.

So it works fine now, but I’m just curious - what is the rationale for  
making POST the default request method? In a non-ajax request, the GET  
method is used, as required for the “new” action implied by my choice  
of URL. But not for the ajax form of request. I’m puzzled about the  
thinking behind this.
