I am new to ruby on rails and i am able to select the value from select
box but after reloading the page the select box selected value is not
selected, please help me...
I am new to ruby on rails and i am able to select the value from select
box but after reloading the page the select box selected value is not
selected, please help me...
If you're posting this to itself, and you expect the select to default, you're going to have to name the GET parameter exactly the same as Rails named the select. Try changing the window.location part to
You may have to fiddle with this a bit, but the basic premise is that if you name the parameter exactly the same way that Rails would, When you come back to the form, that select will be defaulted to match.
There is also another trick you could try, and that is the :default parameter to the select() method. Set that to the value, so in this case, params[:vid], and see if that does the same thing. Less changes in your code that way.