Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass URL parameters to the root [in the routes.rb] in Ruby on Rails

realize this question is similar to this one.

Pass URL parameters to a redirect_to :root

However, I'm wondering to start the application with parameters passed at the outset. Perhaps root :to in the routes.rb file is not exactly the correct way to go?

Was basically hoping that it would start like this.

http://localhost:3000/controller?hello_id=1&finder_id=1&laser_id=1&sharks_id=4

Any thoughts would be really appreciated!

like image 980
Andrew Chung Avatar asked Dec 07 '11 17:12

Andrew Chung


1 Answers

Perhaps it has changed in the last couple years, but this is definitely possible now:

root to: 'controller#action', hello_id: 1, finder_id: 1, laser_id: 1, sharks_id: 4
like image 106
Michael Johnston Avatar answered Oct 01 '22 00:10

Michael Johnston