Is there a good way to integrate hstore
with simple_form
?
I just cannot find a way to achieve this. I have a column called widget_locations
and I would like to store :left_area1, :mid_area1, :left_area2, :mid_area2, :right_area2
as keys and values as nested hashes so they are like below:
{:left_area1 => {:video_id => 1, :presentation_id => 3}, :mid_area1 => {:chat_id => 1, :presentation_id => 5}, :left_area2, :mid_area2, :right_area2}
Is there a best way to achieve this in simple_form?
You can do something like this
<%= f.simple_fields_for :widget_locations do |location| %>
<%= location.input :left_area1, :input_html => { :value => <value> } %>
<%= location.input :mid_area1, :input_html => { :value => <value> } %>
<% end %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With