The easiest way is probably just "if request.post?" 

Be careful though - it could be a post request without the parameters you 
are looking for. Might also be helpful to check if the params hash contains 
the keys you plan on using.

Another option is to just try it, then ask for forgiveness:

begin
  Date.new(params[:year].to_i, params[:month].to_i, params[:day].to_i)
rescue ArgumentError
  # could not create date from parameters
end

-- 
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