Simple translation

I have a date

type attribute date

.

= f.input :date

      

And simple_form

raises an exception:

undefined method `map' for "translation missing: fr.date.order":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:

section
  .row
    h1= t('actions.new')

  .row
    = 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
    t.date     "date",                           null: false
    t.string   "amount_estimation", default: "", null: false
    t.text     "description",       default: "", null: false
    t.string   "tags"
  end

      

Model:

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

      


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

+3


source to share


2 answers


If you are using a language other than :en

that, you need to install the rails-i18n

gem.



+7


source


1) Also, should be used js.coffee

, as usage js.coffee.haml

causes conflicts with haml and coffee.

So the answer is no, it seems like you can't use js.coffee.haml

, just use js.coffee.erb

which is actually activated by an extension js.coffee

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โ€ฆ"

      

-1


source







All Articles