On 18 Jan 2011, at 18:52, "Got Josh?" <[email protected]> wrote:

> I would like to do that's the best way of actually accomplishing the
> following on Rails.
> 
> I have a "Booking Form" with 5 fields (Property, Amount of Children,
> Amount of Adults and 2 Dates - Departure and Arrival) based on these
> fields, I need to construct an URL and redirect the user to this url.
> Now, I have 2 questions.
> 
> 1) How i catch the POST parameters in the controller, because I'm
> mapping the form to an action like this:
> 

They'll be in params. You might make your life slightly easier if you name your 
parameters foo[p1], foo[p2] etc, because then all your parameters are in 
params[:foo]. Hash#to_query turns a hash back into a query string. 

> <% form_tag(:action => "booking") do %>
> 
> and routing it to a controller action like this: (Pages Controller,
> Booking Action)
> 
> match 'pages/booking' => 'pages#booking'
> 
> 2) Is this the Rails way of actually accomplishing such thing?
> 

I don't quite understand what you are doing. What's the point of the 
intermediate action?

Fred
> I did it this way in PHP in the past, but now I have the need of
> actually doing it in Rails, could you Rails Gurus inspire me ?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en.

Reply via email to