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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:10:39+00:00 2026-06-04T18:10:39+00:00

I would appreciate it if someone could help me with the following issue. I

  • 0

I would appreciate it if someone could help me with the following issue.

I have in my form the following code:

Type:  <%= f.select(:SUB_TYPE, [
            ['type A', 'type A'],
            ['type B', 'type B'],
            ['Type C', 'type C']
            ],{ :prompt => "Please select"}
            ) %>



  <% f.fields_for :author do |builder| %>
  <%= render :partial=>'sub/formAuthor', :locals => {:f => builder, :sub_type_selected => value_of_selected_type} %>
  <% end %>

I need to pass the type selected by the user to the partial ‘formAuthor’ and I would like to do so by passing the selected type value via the variable ‘:sub_type_selected’.

My question is how do I pass the value of the selected type to that partial.

Any suggestion is most appreciated.

  • 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-06-04T18:10:41+00:00Added an answer on June 4, 2026 at 6:10 pm

    You cannot do that. The selected value is not known when the partial is built. The partial is processed before the user even sees the drop down. You should either hide the partial block, and load it after the user makes a selection, or load for all values and use tabs or similar mechanism to hide/ show. Basically, you will have to manage it with javascript or ajax.

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

Sidebar

Related Questions

I would appreciate if someone could help/explain the following please. I am trying to
if someone could help on the following would appreciate this as I spent the
Just wondering if someone could help me with the following issue. On my local
I was wondering if someone could help me. I have the following two tables:
Would someone please provide me an example of the following Activity/Service/Application combination. I have
I don't understand what's happening here. If someone could explain, I would appreciate it.
I just cannot get this to work, would appreciate if someone can help. So
I would appreciate some help with something I working on and have not done
I would appreciate any help on this issue. Lets say I want to load
I'm relatively new to Java and would appreciate any help on this! I have

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.