Don’t know how to use a link_to directive where one of the parameters
is
taken form a form field (client side), eg:
…
The field “numrows” is used to dynamically change the number of rows
per page
in a pager (ok, let apart will_paginate and other paginate plugins)
#Rows per Page :
<%= text_field_tag “numrows”, session[:nr] ||
Customer.per_page, :size
=> 5 %>
<%= link_to ‘Change #Rows per Page’, {:action => ‘set_row_per_page’,
:rowsperpage => <would like to pass here the content of “numrows”
field>, :method => :post, :class => “IsALink” %>
Note that “numrows” is a non-model field of the form.
How can i dynamically set the value of “:rowsperpage” so that clicking
on the link will restart pagination with a differente number of rows
per page. I need to know how to dynamically set up the value of the
parameter using something link $(‘numrows’).value
Any help appreciated.