Search code examples
ruby-on-railssimple-formformtastichstore

simple_form or formtastic Input type for hstore


Does anybody know any simple_form or formtastic input for hstore? I tried to search for any input but I didn't find any yet... It seems that the hstore field type is not yet supported...

I would need it...


Solution

  • You may use like this for input as hstore:

     <%= simple_form_for @product do |f| %>
       <%= f.simple_fields_for :attributes do |d| %>
           <% f.object.attributes.try(:each) do |key, value| %>
              <%= d.input key, :input_html => {:value => value } %>
           <% end %>
       <% end %>
    <% end %>