2

I am new to Ruby Rails. I am redirecting my page to /user/locations using redirect_to user_locations_url and I want to append a query string like ?code='value' which makes it like user_locations_url?code='value'.

How do i use it with redirect_to to pass query string parameters.

Thank you!

1 Answer 1

3

You can do redirect_to user_locations_url(code: 'value')

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! But I tried this. But gives me rails error with syntax. And does not redirect to the mentioned URL

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.