# No route for :method =\> :get

**URL:** <https://www.ruby-forum.com/t/no-route-for-method-get/110980>\
**Category:** Rails\
**Created:** [August 1, 2007, 6:16pm UTC](https://www.ruby-forum.com/t/no-route-for-method-get/110980 "2007-08-01T18:16:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 1, 2007, 6:16pm UTC](https://www.ruby-forum.com/t/no-route-for-method-get/110980/1 "2007-08-01T18:16:24Z")

</div>

I have been trying to get my application to simply pop open a simple  
widow with a form laid out in that window. I get it to open this window,  
but the error I get says:

no route found to match “/enroll/airline\_preferences.rhtml” with  
{:method=\>:get}

I have tried to place :method =\> ‘post’ in my code with little success.  
I guess I don’t understand hwo different does RoR dehave based on  
whether it is a get or a post? Posts executes the method with the same  
name as the page upon load. How is get different. Also, I am using  
link\_to to open up this page. Thanks,

~S

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 1, 2007, 6:45pm UTC](https://www.ruby-forum.com/t/no-route-for-method-get/110980/2 "2007-08-01T18:45:53Z")

</div>

On Aug 1, 2007, at 12:16 PM, Shandy N. wrote:

> success.  
> I guess I don’t understand hwo different does RoR dehave based on  
> whether it is a get or a post? Posts executes the method with the same  
> name as the page upon load. How is get different. Also, I am using  
> link\_to to open up this page. Thanks,
> 
> ~S

Well, seeing your routes.rb (the part that you expect to be relevant)  
would certainly help. You can manually add:

:conditions =\> { :method =\> :put }

to your map.connect (or named route) to require a certain type of  
request (the default is to allow any)

You should also show the piece of your view that implements the form.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 3, 2007, 4:49am UTC](https://www.ruby-forum.com/t/no-route-for-method-get/110980/3 "2007-08-03T04:49:52Z")

</div>

if you’re using restful routes, e.g. “map.resources :enroll” in your  
routes, then you can add such a URL via

map.resources :enroll, :collection =\> { :airline\_preferences =\> :get }

that enables the URL /enroll;airline\_preferences

it also provides the named route airline\_preferences\_enroll for usage  
in controllers and views to generate the URL.

On Aug 1, 12:16 pm, Shandy N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
