Last active
August 29, 2015 13:56
-
-
Save rockkhuya/8816363 to your computer and use it in GitHub Desktop.
use cocoon to create nested
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
accepts_nested_attributes_for :tour_irregular_schedules, | |
allow_destroy: true, reject_if: proc { |a| a["start_date"].blank? && a['all_season_flg'].blank? } |
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
<div class="control-group"> | |
<%= f.label 'イレギュラースケジュール', class:'control-label' %> | |
<div class="controls" id="tour_irregular_schedule_controls"> | |
<%= f.fields_for :tour_irregular_schedules do |tour_irregular_schedule_fields| %> | |
<%= render "tour_irregular_schedule_fields", f: tour_irregular_schedule_fields %> | |
<% end %> | |
<p><%= link_to_add_association "イレギュラースケジュール追加", f, :tour_irregular_schedules %></p> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment