我有date
屬性Date
類型。simple_form缺少翻譯
= f.input :date
而且simple_form
引發了一個異常:
undefined method `map' for "translation missing: fr.date.order":String
我不應該在默認情況下做任何事情。翻譯應該沒問題。我不知道我應該尋找什麼。
的完整代碼視圖:
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
的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
型號:
class GroupAction < ActiveRecord::Base
belongs_to :lawyer, class_name: User, foreign_key: 'user_id'
end
一位同事建議我使用order
選項一個解決方法:
= f.input :date, order: [:day, :month, :year]
這擺脫了例外,但我仍然有默認翻譯的麻煩。在下面的圖片中,它是應該在月份列出的select元素。
你可以發表你的完整的錯誤消息,並且更多的代碼來闡述 – Bijendra 2014-10-09 07:56:04
我沒事發布更多的代碼,但我不知道該怎麼因爲我不知道還有什麼可以的暗示... – 2014-10-09 08:16:24
@AdrienGiboire請張貼您的整個表格和型號代碼 – anusha 2014-10-09 08:19:55