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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:32:57+00:00 2026-06-15T20:32:57+00:00

I´m newbie in Ruby on rails, and I´m trying to display a select with

  • 0

I´m newbie in Ruby on rails, and I´m trying to display a select with the ids from an object b) in an object a):

Object a) Function

Object b) Experience

function _form.html.erb

<div class="field">
<%= f.label :experience_id %><br />
<%= f.number_field :experience_id %>

I want to create a select which display the items in the table experience. I suppose it’s a loop that loops through wich all elements of @ experience but not how. I have read about form helpers but I can not enlighten.

Thank so much

About Second Question

Thanks very much for your help. I tried like you proposed but the name of the select tag was not the correct name of the object and i don´t know how put it with that helper method. So i tried the same with another helper, select, and was success:

Option a)
select_tag :habilidad, options_for_select({“1” => 1, “2” => 2})

Resultant Source code:

<div class="field">
    <label for="skill_habilidad">Habilidad</label><br />
    <select id="habilidad" NAME="habilidad"><option value="1">1</option>
<option value="2">2</option></select>
  </div>

Option b)
select(:skill, :habilidad, {“1” =>1, “2” => 2, “3” => 3, “4” => 4, “5” => 5})

Resultant source code:

<div class="field">
    <label for="skill_habilidad">Habilidad</label><br />
    <select id="skill_habilidad" NAME="skill[habilidad]"><option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option></select> 
  </div>
  • 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-15T20:32:58+00:00Added an answer on June 15, 2026 at 8:32 pm

    You could use select_tag with options_for_select like this:

    <%= select_tag :skills, options_for_select((1..5).to_a.map { |val| [val,val] }) %>
    

    You can replace (1..5).to_a for a variable.

    Reference: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-options_for_select

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

Sidebar

Related Questions

I a newbie trying to write a [Ruby ON Rails] spec to make sure
hey I am newbie to ruby on rails and I am trying run a
Still a rails and ruby newbie, and I'm trying to figure out why adding
Newbie to Ruby on Rails and Twitter Bootstrap :P Trying to add a popover
I am trying to learn rails from http://ruby.railstutorial.org/ Exercise 3 explains to install rspec,
I'm Ruby/Rails newbie and trying to get the laika tool ( http://github.com/CCHIT/laika/tree/master ) running
I am a newbie to Ruby on Rails and I am trying to learn
I am a newbie to Ruby on Rails and trying to setup oracle based
I'm newbie on ruby on rails and I'm trying to test my controller with
I am a newbie to Ruby on Rails . I have started working on

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.