9

Is it possible to pass url parameters with this type of redirect_to?

redirect_to contact_path(@contact), :show_family => 'yes'

I want a URL that results in:

/contacts/1?show_family=yes
1
  • Note: the above provided redirect_to doesn't seem to work at the moment. Commented Feb 4, 2010 at 22:17

1 Answer 1

14

Yes, just pass your query string parameters in to contact_path:

redirect_to contact_path(@contact, :show_family => 'yes')
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Works great. Silly me didn't even think about including that parameter inside the parenthesis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.