Created
August 13, 2014 13:05
-
-
Save gerardvcruz/8db73ef31a3b48809ff0 to your computer and use it in GitHub Desktop.
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
<% form_for @object do |f| %> | |
<%= f.label :foo %> | |
<%= f.text_field :foo %> | |
<% f.fields_for :bar do |ff| %> | |
<%= ff.radio_button :some_attr, 1 %> | |
<%= ff.label :some_attr %> | |
<%= ff.radio_button :some_attr, 2 %> | |
<%= ff.label :some_attr %> | |
<% end %> | |
<%= f.submit %> | |
<% end %> |
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
def new | |
@object = Object.new | |
2.times { @object.bar.build } | |
end | |
def create | |
@object = Object.new(object_params) | |
respond_to do |format| | |
# other stuff | |
end | |
end | |
end | |
private | |
def object_params | |
params.require(:holiday_package).permit(:foo) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment