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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:32:33+00:00 2026-05-26T04:32:33+00:00

I would like to know if thereis a plugin or a tutorial at least

  • 0

I would like to know if thereis a plugin or a tutorial at least on how to make a dynamic select form?

I am trying to select the car name using f.select and depending on what carname is selected in the next f.select will be displayed only models that belongs_to the car name.
I’ve tried the Railscasts solution, but it seems that it’s for older version of rails or I did something wrong.
Thanks.

I use rails 3.0 and the railscasts I tried is http://railscasts.com/episodes/88-dynamic-select-menus

  • 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-26T04:32:33+00:00Added an answer on May 26, 2026 at 4:32 am

    There is no automatic way (if I understand correctly – when the user chooses carname in some select box, the options in another select box must change accordingly). I will assume carmodel is a select box but if it’s a textbox you can still use the same solution. You basically have 2 options:

    • in both options you must hook into on change event of the select box. you can use e.g. jQuery for this: http://api.jquery.com/change/
    • Option 1 without Ajax: output all the car models in JSON format into the page (like var carModels = {…}), and then in on change event of the carname select box, use javascript/jQuery to add only the appropriate models from carModels into the select box options
    • Option 2 with Ajax: on select of the carname select box, send Ajax request ($.post from jQuery) to the server with the information about selected value in carname. the server should give back the list of appropriate car models in JSON format. after you get this result back, just insert all the values into the select box. For returning this data in json format from server you need to create a post action like get_models. To return the data in json format you can use render :text => @models.all.to_json

    The Ajax solution will be easier because you need less Javascript logic.

    To see how to add options to select box with jQuery look at this question: What is the best way to add options to a select from an array with jQuery?

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

Sidebar

Related Questions

I'm using the sfGuardDoctrine plugin, and I would like to customize the form validation
I'm using the wonderful Taglist plugin with Vim and I would like to know
I would like to know if there is a simple algorithm (or jQuery plugin)
I would like to know,If there is a Hudson plugin to reduce the build
I would like to know if there is any way to add custom behaviour
I would like to know if there is some way to share a variable
I would like to know if there is a way to disable automatic loading
I would like to know if there is an easy way to detect if
I would like to know if there is any easy way to print multiple
I would like to know if there is a simple way to parse HTML

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.