I have a date attribute of Date type.
= f.input :date
And simple_form raises an exception:
undefined method `map' for "translation missing: fr.date.order":String
I am not supposed to do anything by default. Translations should be okay. I have no clue what I should look for.
The full code view:
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
The group_action schema:
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
The model:
class GroupAction < ActiveRecord::Base
belongs_to :lawyer, class_name: User, foreign_key: 'user_id'
end
A colleague proposed me to use order option as a workaround:
= f.input :date, order: [:day, :month, :year]
This gets rid of the exception but I'm still having trouble with default translations. On the image below, it's the select element where are supposed to be listed the months.

If you use a different locale than :en, you have to install rails-i18n gem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With