Simple translation

I have a date

type attribute date


= f.input :date


And simple_form

raises an exception:

undefined method `map' for "translation missing:":String


I don't have to do anything by default. Translations should be fine. I don't know what I should be looking for.

Complete code:

    h1= t('')

    = simple_form_for @group_action, url: admin_actions_path do |f|
      = f.input :concerned_object
      = f.input :concerned_company
      = f.input :date
      = f.input :amount_estimation
      = f.input :description
      = f.input :tags

      = f.button :submit


Scheme group_action


  create_table "group_actions", force: true do |t|
    t.integer  "user_id",                        null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "concerned_object",  default: "", null: false
    t.string   "concerned_company", default: "", null: false     "date",                           null: false
    t.string   "amount_estimation", default: "", null: false
    t.text     "description",       default: "", null: false
    t.string   "tags"



class GroupAction < ActiveRecord::Base
  belongs_to :lawyer, class_name: User, foreign_key: 'user_id'


A colleague suggested that I use the option order

as a workaround:

= f.input :date, order: [:day, :month, :year]


This gets rid of the exception, but I'm still having problems with the default translations. In the image below, this is the picker where the months should be specified.

enter image description here


source to share

2 answers

If you are using a language other than :en

that, you need to install the rails-i18n




1) Also, should be used

, as usage

causes conflicts with haml and coffee.

So the answer is no, it seems like you can't use

, just use

which is actually activated by an extension

that implicitly appends .erb

to the end of it.

2) I used a simple form and my form should look like this:

= simple_form_for @entry, remote: true do |f|
  = f.input :body
  = f.button :submit, :disable_with => "Submittingโ€ฆ"




All Articles