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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -