Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6907165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:24:05+00:00 2026-05-27T08:24:05+00:00

I am using the jQuery UI slider to dynamically update items on a page.

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:24:05+00:00Added an answer on May 27, 2026 at 8:24 am

    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:

    get "article/between_years", :controller=>"article", :action=>"between_years"
    

    and in your controller, you’ll have the function

    def between_years
      @articles = Article.where(:year => params[start_year]...params[start_year])
      render :layout=>false ### this line makes it so the application.haml (or html.erb) is not rendered along with your code)
    end
    

    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:

    $.get("/article/between_years",{start_year:1991,end_year:2011},function(data, status, xhr){  /// does ajax call to the article route we set up above /
      ..
      $("body").append(data);  ///appends the html data returned to the body
                               ///you will probably want to change this a bit
                               ///so every thing is added to the proper place
      ...
    });
    

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that has multiple sliders (from http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div ) and since each
I'm using the jquery ui slider for zooming. It's supposed to zoom from 25%
I have a page which contains a jQuery-UI horizontal slider, created using a little
I'm using jQuery to dynamically add two divs on page load. It all works
I am using the jQuery UI slider from Filament group where it will convert
I'm using a jQuery Range slider to let users select a time range in
Using the Slider Jquery plugin from Egor Khmelev, I've managed to set the slider
I am using the jquery slider and using append() to update the value, but
I am using the jquery slider from http://www.gmarwaha.com/jquery/jcarousellite/ and the jquery kwciks as shown
I'm getting the below error when using jquery ui slider while update via ajax:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.