how to get value from select box in rhtml page

I Hope it will work for you,

<%= link_to “Bai 2”, :controller => ‘Your_controller’, :action => ‘your_action’, :id => @params[‘bookID’] %>

Hi Thuy,

Thuy Tien wrote:

when i get value of id from controller pages by params[:id] it return the nil value. maybe @params just can work in controller pages so when we put it in rhtml pages it can't work

Sorry I didn't spot this earlier, but yes. The params hash is how information is passed from the client browser to the server. It is constructed and populated by the browser to send a request to the server. In Rails, requests are handled by invoking a method in a controller. Instance variables (e.g. @some_name) are the mechanism in Rails for passing values from the controller to the view (i.e., the rhtml pages) that Rails is using to construct the page that will supply the response to the browser's request.

hth, Bill