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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:23:08+00:00 2026-05-13T23:23:08+00:00

So I haven’t been doing this for long but I’m completely stuck on this.

  • 0

So I haven’t been doing this for long but I’m completely stuck on this. I have a model which looks like this (simplified for brevity):

class ReqBreakdown < ActiveRecord::Base
  belongs_to :next_level #nil if lowest level
  belongs_to :previous_level #nil if highest level
  belongs_to :requirement_level
end

I need a way to build these lists from the UI. I had initially envisioned using linked drop-downs like those described here: http://blog.jatinder.me/2006/09/cascading-select-boxes-with-rjs.html but I can’t even get it to call the action on my controller. I copied the described javascript into my application.js, made sure it was included in my layout, added the helper to application_helper.rb, and added the supporting actions to my controller, but no luck. Honestly, I’m not even sure it will meet my requirements.
The rules for selection are:

  1. Up to 4 levels (i.e. 4 select boxes).
  2. No circular references (i.e. all previously selected items must be removed from the next text-box to be selected)
  3. Selected objects are all of the same type (requirement_level)

Any suggestions?

  • 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-13T23:23:09+00:00Added an answer on May 13, 2026 at 11:23 pm

    Since you are still getting starting, might I suggest you watch the excellent railscasts episodes? Particularly the one here:

    • http://railscasts.com/episodes/88-dynamic-select-menus

    I know this may not be the answer you are looking for, but since you are having trouble getting your controller hooked up to do anything you want, your issue could really be anywhere. Ryan (author of railscasts) does a great job explaining the small stuff, as well as providing full source code to all his episodes.

    If this were me, I would probably do one of two things.

    1. Ditch rjs, and use jquery client side for pretty much the whole thing. jquery really excels here. If the list of data is static, all the better, but if not you can use ajax to update things for you as you go.
    2. Look at a different UI element, perhaps a multi-select box or group of checkboxes, depending on the situation.

    I have no problem with the direction you are looking but since you are a bit light on technical details for the question, I’m really just giving some general advice rather than a specific answer.

    Good luck!

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I haven't been able to find any real documentation on this, so I'm wondering
I haven't actually done this yet, and maybe I don't need to, but it
I haven't seen this question anywhere else, I hope someone can help. I have
I haven't found any documentation on this or seen this done before, but is
I haven't worked with SQL Reporting much, however I have been trying to get
Haven't been programming in JS for a while. Now, I have following thing: <html>
Haven't seen anything, but I have seen that you can create albums in the
Haven't been coding in a bit, but took on a project for a friend.
I haven't been able to solve this prolog exercise. I was hoping someone here

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.