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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:04:01+00:00 2026-06-10T03:04:01+00:00

I have checked some tutorials but I got confused by the parameters in this

  • 0

I have checked some tutorials but I got confused by the parameters in this method

collection_select (object, attribute, collection, value_method, text_method, options = {}, html_options ={})

I have a map model includes: :area, :system, :file

and I want to read :area from database to a drop down list, and let user choose one

I already did @map = Map.all in the view

what the method should be?

especially the parameter “attribute”. In a lot tutorials, people put “id” here. But I don’t know what “id” is, and in my situation I don’t need any other value, just the “area”.

  • 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-10T03:04:02+00:00Added an answer on June 10, 2026 at 3:04 am

    Im not exactly sure what you are asking here but if you are trying to make a dropdown selection for use in an html form will this example help you at all?

    <% nations = {'United States of America' => 'USA', 'Canada' => 'Canada', 'Mexico' => 'Mexico', 'United Kingdom'=> 'UK'} %>
    <% list = nations.sort %>
    <%= f.select :country, list, %>
    

    Here nations is a hash of countries then list becomes the sorted copy of that hash. An html dropdown is then created as a part of the form “f”. “:country” is the part of the model that the data is connected to while list is the options to populate the dropdown with

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

Sidebar

Related Questions

I have checked this similar question, but the suggestions did not solve my problem:
Have checked some backbone.js tutorials and can't understand how to get model id from
I have some javascript code which orginally checked/unchecked multiple checkboxes which was great. But
I have checked Oracle Java API, which gives some info that FutureTask.isDone() but I
I have checked few other posts and found some UIAnimation transitions that kind-of give
I have a ListView with multiple choice entries where some are checked from the
I have a checkbox which in some cases may be disabled and checked using
I have checked many questions here but none has my answer. I appreciate if
I have been working on XNA for quite some time, but was asked to
I have checked some documentions about the Facebook api that communicates with flash and

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.