Skip to content

Instantly share code, notes, and snippets.

@amardaxini
Created March 29, 2012 08:41
Show Gist options
  • Save amardaxini/2235072 to your computer and use it in GitHub Desktop.
Save amardaxini/2235072 to your computer and use it in GitHub Desktop.
Serialize Options
#If you have config1 as serialize parameter it store hash than
# serialize :config1,Hash
<%= form_tag(@user_config) do |f| %>
<%= text_field_tag "user_config[config1][test2]" %>
<%= text_field_tag "user_config[config1][test1]" %>
<%= submit_tag %>
<% end %>
# Now you have an array
<%= form_tag(@user_config) do |f| %>
<%= text_field_tag "user_config[][config1]" %>
<%= text_field_tag "user_config[][config1]" %>
<%= submit_tag %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment