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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:10:56+00:00 2026-05-23T08:10:56+00:00

I have a form for a rails model, where a specific input is saved

  • 0

I have a form for a rails model, where a specific input is saved down as text, and that text is in the drop down in the form.

At the moment, I have the following (using formtastic here):

= f.input :education_level, :as => :select, :collection => ["Some GCSEs or less", "College A levels", "Some University, no degree", "University graduate - Bachelors or equivalent", "Masters degree", "Professional Degree", "Doctorate"], :include_blank => false

Thing is. This doesn’t seem to be a great way of doing this. It’s loaded up my view with something that should probably be in the model, but that’s not very good when it comes to supporting multiple locales.

So, what’s the best way of doing this?

  • 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-23T08:10:56+00:00Added an answer on May 23, 2026 at 8:10 am

    This discussion on the rails-i18n google group has an interesting solution:

    #in a locale file
    en: 
      education_levels: 
        gcses: Some GCSEs or less 
        collegeA: College A levels 
        some_university: Some University, no degree
        bachelors: University graduate - Bachelors or equivalent 
        masters: Masters degree
        professional: Professional Degree
        doctorate: Doctorate  
    
    #And in a model: 
    class Education < ActiveRecord::Base 
      def translated_education_level 
        I18n.t(education_level, :scope => :education_levels) 
      end 
    end 
    
    #In a helper: 
    module EducationHelper 
      def education_levels 
        I18n.t(:education_levels).map { |key, value| [ value, key ] } 
      end 
    end 
    
    #And then in your view: 
    <%= f.select :education_level, education_levels %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails model that validates uniqueness of 2 form values. If these
I would like to have Ajax form in Rails so i'm using form_remote_tag. The
I have the following rails form (which works) but I want to remove the
I've got a model creation form in rails which I also have returning JSON
I have a rails model that I am adding validations to and I seem
I have a House model in my rails app that has_many deals. I am
I have a rails app (running on version 2.2.2) that has a model called
I'm using codebrew\backbone-rails in a nested model example (say I have a collection of
I have a Rails form that is being used for creating and editing a
I have a rails form with a datetime_select field. When I try to submit

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.