Ruby-on-rails – Identify GET and POST parameters in Ruby on Rails


What is the simplest way to identify and separate GET and POST parameters from a controller in Ruby on Rails, which will be equivalent to $_GET and $_POST variables in PHP?

Best Solution

You can use the request.get? and methods to distinguish between HTTP Gets and Posts.