I am using the jQuery UI slider to dynamically update items on a page. How can I let the controller receive the values from the slider? Is it possible to pass such information through as a local? If so, how would the local be handled by the partial
I am currently updating the whole page and using the where clause with the params.
@articles = Article.where(:year => params[start_year]...params[start_year])
I would like to just using jquery to empty this section and render a new collection of partials using the values set by the slider. Is there a best practice for this?
I think the best option would be make an ajax call to a controller and pass in the paramaters through that.
Then, with the returned information, you should repopulate the parts of the page that need to be repopulated.
In your routes, you’ll want something like this:
and in your controller, you’ll have the function
and in the directory app > views > articles, you’ll have the haml, or erb file with the html you’ll be wanting to add in.
then your jquery will look something like this:
I wrote another answer a little while ago that outlined a simular work flow, you may want to take a look at that => Auto populate text_fields based on selected item from another collection_select in Rails 3