I was experimenting today with the merb 'form' helper to see if I
could get it to submit a form using an http GET method instead of POST
(the form is being used to enter a search term to retrieve data from a
db).

What I found is that this works:

<%= form :action => url(:controller => :registrations, :action
=> :new), :method => :get do %>

which generates html :

<form method="get" action="/registrations/new">

But changing the :method parameter to a string -

<%= form :action => url(:controller => :registrations, :action
=> :new), :method => 'get' do %>

generates :

<form method="post" action="/registrations/new"><input type="hidden"
value="get" name="_method"/>

I'm a little curious about this -
(a) is there some rationale behind this difference in behavior or some
general principle I should know that would have enabled me to predict
that this is how it would work (since I haven't seen this documented
anywhere)?
(b) in what circumstances would the second approach be used?

Mark.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to