Here is a piece of code I'm using now:
<%= f.select :project_id, @project_select %>
How to modify it to make its default value equal to to params[:pid] when page is loaded?
params[:pid]
This should do it:
<%= f.select :project_id, @project_select, :selected => params[:pid] %>
1.4m articles
1.4m replys
5 comments
57.0k users