Created
November 26, 2008 19:23
-
-
Save karmi/29512 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <tr> | |
| <td style="width: 25%" class="align-right sortable"><%= text_field_tag 'program_event[entrance_fees][][price]', nil, :class => 's' %> Kč</td> | |
| <td style="width: 50%" class="sortable"> | |
| <!-- <span class="drag_handle"> </span> --> | |
| <%= text_field_tag 'program_event[entrance_fees][][description]', nil %> | |
| </td> | |
| <td> </td> | |
| </tr> | |
This file contains hidden or 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
| class ProgramEvent < ActiveRecord::Base | |
| has_many :entrance_fees | |
| # Complex forms quite complicated, huh? | |
| def entrance_fees=(options) | |
| options.each do |new_entrance_fee| | |
| if entrance_fee = ProgramEntranceFee.create( new_entrance_fee ) | |
| self.entrance_fees << entrance_fee | |
| end if new_entrance_fee[:price] && !new_entrance_fee[:price].blank? | |
| end | |
| end | |
| end | |
This file contains hidden or 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
| Processing Admin::ProgramEventsController#update (for 127.0.0.1 at 2008-11-26 20:18:24) [PUT] | |
| Parameters: {"program_event"=>{"entrance_fees"=>[{"price"=>"7000", "description"=>"Seven thousand"}, {"price"=>"8000", "description"=>"Eight thousand"}], ...}, } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment