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 6703995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:14:14+00:00 2026-05-26T07:14:14+00:00

I am trying to auto populate the drop down list box based on the

  • 0

I am trying to auto populate the drop down list box based on the selection from the previous drop down. I saw an example in the web and it uses replace_html in the controller. The rest of my application is based on the jquery.Could you please let me know how to achieve it with jquery.

My Controller code:

def  update_releases 
  puts "inside func"
  project = Project.find(params[:project_id]) 
  @releases = project.releases
  render :update do |page| 
    page.replace 'releases'
    page.replace_html 'cycles', :partial => 'cycles', :object => cycles
  end
end
  • 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-26T07:14:14+00:00Added an answer on May 26, 2026 at 7:14 am

    You can write inline jquery code, like this:

    def  update_releases 
      puts "inside func"
      project = Project.find(params[:project_id]) 
      @releases = project.releases
      render :update do |page|
        page << "$('#cycles').html(\"<%= escape_javascript(render :partial => 'cycles', :object => cycles ) %>\" );"
      end
    end 
    

    better is to use js.erb files (given that you’re using rails3):

    def  update_releases 
      project = Project.find(params[:project_id]) 
      @releases = project.releases
      respond_to do |format|
        format.js
      end
    end
    

    and create a update_releases.js.erb template:

    $('#cycles').html("<%= escape_javascript(render :partial => 'cycles', :object => @cycles ) %>" )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to auto-populate a text field based on the value of another
I'm trying to figure out how to auto generate/populate a column in excel based
I'm tyring to use AJAX to populate a dropdown box based on the selection
I am trying to auto populate a select box in rails with a relational
I am trying to auto-populate a text field based on the value of another
I'm trying to create an auto generated post excerpt from the current page's post
I am trying to use AJAX to populate some select boxes that were auto-generated
I'm trying to create an auto-complete box and have been having problems due to
i am trying to auto populate the latitude and longitude field in my forms
So I am trying to populate the slideshow div with images from a external

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.