Passing parameters in rails redirect_to

ruby-on-rails

Solution

Just append them to the options:

redirect_to controller: 'thing', action: 'edit', id: 3, something: 'else'

Would yield `/thing/3/edit?something=else`

Problem

How do we pass parameters in redirect_to in rails? I know we can pass id using this: ``` redirect_to :action => action_name,:id => 3 ``` If I want to pass additional parameters like some form data how to achieve it? EDIT: For Ruby 2 syntax you have to update the snippet above to: ``` redirect_to action: action_name, id: 3 ```

Original source