我有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