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

  • Home
  • SEARCH
  • 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 5937551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:33:27+00:00 2026-05-22T15:33:27+00:00

I am all new to rails, however quite familiar with regular MVC programming like

  • 0

I am all new to rails, however quite familiar with “regular” MVC programming like Spring and .net. I am trying to cope with all this new way of doing stuff, but I keep getting stuck – especially when it comes to rendering/refreshing the same view with different data, based on a selection a user has made.

This is properly all really simple, and I can see it has been asked a lot of times – although, I cant seem to find any definite and “this is the rails way of doing it” answer.

All I want to do is the like this:

Database “scheme”, with table a,b,c and their references:
C -> A
C -> B

Based on a selection of B in a drop down, I want to show all the “A’s Cs” – dont mind the querying part, that is straight forward.
By now I choose the first B as a “first render” of the page in my controller, but when the user selects another B in the dropdown, the view should be rerendered based on the selection…
I dont want to use custom javascript filling or some other “weird” way. I must be possible to select something and refresh the view based on the selection in RoR.

I hope you either can help me or point me in the right direction.

Thanks!

  • 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-22T15:33:27+00:00Added an answer on May 22, 2026 at 3:33 pm

    Put all these select lists in a form and in the ‘onchange’ event of the lists add javascript that submits the form ($(‘form_name’).submit()). Once you submit the form, you have all the selected values as params (params[:select_list_1], params[:select_list_2]). Process them as you want, fire queries and display the view again.

    You could submit the form to the same action. The action would be something like this:

    def index
      if !request.post?
        # Generate default values
      else
        # Generate new resultset based on params
      end
    end
    

    EDIT (Form example): The form can be added as and :url specifies the action of form element:

    <%= form_for(:select_list_form, :url => {:controller => "my_controller", :action => "index"}) do |f| %>
    <!-- Your select list here -->
        <%= f.submit "Continue", :class => "form-button form-left" %>
    <% end %>
    <!-- Render data based on your instance variables -->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am all very new to this and am trying to use extended hex
rails 2.3.4, sqlite3 I'm trying this Production.find(:all, :conditions => ["time > ?", start_time.utc], :order
I'm new to rails and still learning how it all works. I'm trying retrieve
I'm new to Rails and don't grasp yet all the possibilities with associations. Here's
I'm pretty new to Javascript, Rails and JQuery all working together. I'm going through
im all new to framework. so the structure of code igniter looks like: system
We are trying to get the Model-View-Presenter pattern used on (virtually) all new dev
I am trying to make a firefox extension which looks at all the new
I'm fairly new to rails (only about a month's experience), so this may be
I'm quite new to Rails, so please excuse any wildly inaccurate terminology. First, some

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.