← Back to Upcase

Merging parameters from a select box


(Scott Hollinshead) #1

Hi,

I have created a select_tag within a form and I want to appened the :per_page parameter to the url so it keeps everything else in tact.

This is what I have

<%= form_tag 'catalog/products', method: :get do %>
  <%= select_tag :per_page, options_for_select([32,64,96], params[:per_page].to_i) %>
<% end %>

The url would look something like this at first

http://localhost:3000/catalog/products/Hand_Tools?lv2=Hammers-mallets&pagetype=C&search=hammer so I would need to keep all of that and add the :per_page paramter to it.

Please help :smile:

Thanks,