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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:20:40+00:00 2026-06-05T09:20:40+00:00

I am using the best_in_place gem to edit records inline and country_select to render

  • 0

I am using the best_in_place gem to edit records inline and country_select to render a list of countries to select from. When using best_in_place to edit a select field i do this:

<%= best_in_place(@home, :country_name, :type => :select, :collection => [[1, "Spain"], [2, "Italy"]]) %>

Now i like to get a list of all the countries that country_select has and pass that into the collection parameter.
The country_select gem provides a simple helper to render the select field:

<%= country_select("home", "country_name") %>

I would like to replace the :collection parameter in best_in_place helper to include the list of countries provided by country_select. I know that best_in_place expects the [[key, value], [key, value],…] input into :collection, but i am not sure how to do this. Please advise. 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-06-05T09:20:42+00:00Added an answer on June 5, 2026 at 9:20 am

    Just do the following and it will work:

    <%= best_in_place @home, :country, type: :select, collection: (ActionView::Helpers::FormOptionsHelper::COUNTRIES.zip(ActionView::Helpers::FormOptionsHelper::COUNTRIES)) %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the best_in_place gem to edit balances: index.html.erb: <%= best_in_place bankaccount, :balance, :display_with
I am using best_in_place gem to do some inline editing in a Rails app.
The span tag currently looks like this: <span class='best_in_place<%= ' list-downvoted' if upload.downvoted? %><%=
What is the best method of using native menus in C#? Edit: I want
What is the best practise for using the this keyword in Java? For example,
I am trying to update a record from an index using either jQuery alone
What is the best approach in using a timer. Use a System.Timer.Timer class or
What is the best using for show loading message when request is performing in
Using Prism - what is the best way to handle navigation in a WPF
What are your best examples of using Reflection in production code?

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.