Created
September 13, 2012 15:54
-
-
Save lucasdavila/3715290 to your computer and use it in GitHub Desktop.
Dynamic form for hstore attributes in rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= 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 %> |
How does form look like If I have multiple rows (array of products) ? Thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🤘