No route for :method => :get

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

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
[email protected]

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. [email protected]