ruby on rails - simple_form no input found for json -
environment mac os x rails 4.0.4 ruby 2.1.1
gems: simple_form
create model json typed field, here migration file:
create_table :my_model |t| t.string :name t.json :my_field t.timestamps end
and when try create new object (new form), getting error
runtimeerror - no input found json: simple_form (3.0.2) lib/simple_form/form_builder.rb:551:in `find_mapping' simple_form (3.0.2) lib/simple_form/form_builder.rb:482:in `find_input' simple_form (3.0.2) lib/simple_form/form_builder.rb:111:in `input'
i guessing simple_form not handling json type well, , don't know how work around 1 (newbie simple_form).
hope can help
simple_form, doesn't support json
type natively. turns out, json text based data format, can simple use textarea output json.
<%= f.my_field, as: :text %>
this should work fine
Comments
Post a Comment