0
在带有postgres的Rails 4.2应用程序中,字段ui_layout
在db表(psql支持json数据类型)中转换为json
。 ui_layout
曾经是text
字段。在db表转换ui_layout
到json
后,输入表格new
的呈现返回错误如下:Rails 4.2:带有json字段的输入表单的错误
ActionView::Template::Error (No input found for json):
48: <%= f.input :footer, :label => ('Footer') %>
49: <%= f.input :time_periods, :label => ('Time Periods') %>
50: <%= f.input :max_time_period, :label => ('max Time Period') %>
51: <%= f.input :ui_layout, :label => ('UI Layout (json)'), :input_html => {:rows => 2} %>
52:
53:
54: <div class="btn-toolbar" >
simple_form (3.1.1) lib/simple_form/form_builder.rb:574:in `find_mapping'
simple_form (3.1.1) lib/simple_form/form_builder.rb:503:in `find_input'
simple_form (3.1.1) lib/simple_form/form_builder.rb:113:in `input'
/home/ubuntu/.rvm/gems/ruby-2.1.2/bundler/gems/onboard_data_uploadx-f2c20c94f7d6/app/views/onboard_data_uploadx/dashboard_details/_form_new.html.erb:51:in `block in __home_ubuntu__rvm_gems_ruby_______bundler_gems_onboard_data_uploadx_f_c__c__f_d__app_views_onboard_data_uploadx_dashboard_details__form_new_html_erb__2939072899287253628_79696400'
actionview (4.2.0) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionview (4.2.0) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
在new
输入形式中,ui_layout
作为text
场处理。什么是进入json
字段的正确方法?我是否需要输入文本并将其转换为控制器中的json
?非常感谢。