Created
October 10, 2010 01:09
-
-
Save esparkman/618804 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
| <%= form_for([@client, @person]) do |f| %> | |
| <%= f.error_messages %> | |
| <p> | |
| <%= f.label :first_name %><br /> | |
| <%= f.text_field :first_name %> | |
| </p> | |
| <p> | |
| <%= f.label :last_name %><br /> | |
| <%= f.text_field :last_name %> | |
| </p> | |
| <p> | |
| <%= f.label :emp_id %><br /> | |
| <%= f.text_field :emp_id %> | |
| </p> | |
| <p> | |
| <%= f.label :phone_number %><br /> | |
| <%= f.text_field :phone_number %> | |
| </p> | |
| <p> | |
| <%= f.label :alt_phone_number %><br /> | |
| <%= f.text_field :alt_phone_number %> | |
| </p> | |
| <p> | |
| <%= f.label :email %><br /> | |
| <%= f.text_field :email %> | |
| </p> | |
| <p><%= f.submit %></p> | |
| <% 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
| <form accept-charset="UTF-8" action="/clients/1/people" class="new_person" id="new_person" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="CuHkuHED/Ngivyj9KrG3th5g7W4PGCYAZ2h5wmsBjnw=" /></div> | |
| <p> | |
| <label for="person_first_name">First name</label><br /> | |
| <input id="person_first_name" name="person[first_name]" size="30" type="text" /> | |
| </p> | |
| <p> | |
| <label for="person_last_name">Last name</label><br /> | |
| <input id="person_last_name" name="person[last_name]" size="30" type="text" /> | |
| </p> | |
| <p> | |
| <label for="person_emp_id">Emp</label><br /> | |
| <input id="person_emp_id" name="person[emp_id]" size="30" type="text" /> | |
| </p> | |
| <p> | |
| <label for="person_phone_number">Phone number</label><br /> | |
| <input id="person_phone_number" name="person[phone_number]" size="30" type="text" /> | |
| </p> | |
| <p> | |
| <label for="person_alt_phone_number">Alt phone number</label><br /> | |
| <input id="person_alt_phone_number" name="person[alt_phone_number]" size="30" type="text" /> | |
| </p> | |
| <p> | |
| <label for="person_email">Email</label><br /> | |
| <input id="person_email" name="person[email]" size="30" type="text" /> | |
| </p> | |
| <p><input id="person_submit" name="commit" type="submit" value="Create Person" /></p> | |
| </form> |
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
| def new | |
| @client = Client.find(params[:client_id]) | |
| @person = Person.new | |
| end | |
| def create | |
| @client = Client.find(params[:client_id]) | |
| @person = Person.new(params[:person]) | |
| if @person.save | |
| flash[:notice] = "Successfully created person." | |
| redirect_to client_path(@client) | |
| else | |
| render :action => 'new' | |
| 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
| Started POST "/clients/1/people" for 127.0.0.1 at 2010-10-09 21:07:54 -0400 | |
| Processing by PeopleController#create as HTML | |
| Parameters: {"utf8"=>"✓", "authenticity_token"=>"CuHkuHED/Ngivyj9KrG3th5g7W4PGCYAZ2h5wmsBjnw=", "person"=>{"first_name"=>"Yogi", "last_name"=>"Bear", "emp_id"=>"", "phone_number"=>"", "alt_phone_number"=>"", "email"=>""}, "commit"=>"Create Person", "client_id"=>"1"} | |
| Client Load (0.3ms) SELECT `clients`.* FROM `clients` WHERE (`clients`.`id` = 1) LIMIT 1 | |
| SQL (0.2ms) BEGIN | |
| SQL (0.2ms) INSERT INTO `people` (`alt_phone_number`, `client_id`, `created_at`, `email`, `emp_id`, `first_name`, `last_name`, `location`, `phone_number`, `updated_at`) VALUES ('', NULL, '2010-10-10 01:07:54', '', '', 'Yogi', 'Bear', NULL, '', '2010-10-10 01:07:54') | |
| SQL (0.4ms) COMMIT | |
| Redirected to http://localhost:3000/clients/1 | |
| Completed 302 Found in 79ms | |
| Started GET "/clients/1" for 127.0.0.1 at 2010-10-09 21:07:54 -0400 | |
| Processing by ClientsController#show as HTML | |
| Parameters: {"id"=>"1"} | |
| Client Load (0.3ms) SELECT `clients`.* FROM `clients` WHERE (`clients`.`id` = 1) LIMIT 1 | |
| Person Load (0.4ms) SELECT `people`.* FROM `people` WHERE (`people`.client_id = 1) | |
| CACHE (0.0ms) SELECT `clients`.* FROM `clients` WHERE (`clients`.`id` = 1) LIMIT 1 | |
| Rendered people/_person.html.erb (65.7ms) | |
| Rendered clients/show.html.erb within layouts/application (80.9ms) | |
| Completed 200 OK in 102ms (Views: 86.2ms | ActiveRecord: 4.7ms) | |
| Started GET "/clients/1" for 127.0.0.1 at 2010-10-09 21:08:02 -0400 | |
| Processing by ClientsController#show as HTML | |
| Parameters: {"id"=>"1"} | |
| Client Load (0.3ms) SELECT `clients`.* FROM `clients` WHERE (`clients`.`id` = 1) LIMIT 1 | |
| Person Load (0.5ms) SELECT `people`.* FROM `people` WHERE (`people`.client_id = 1) | |
| CACHE (0.0ms) SELECT `clients`.* FROM `clients` WHERE (`clients`.`id` = 1) LIMIT 1 | |
| Rendered people/_person.html.erb (34.1ms) | |
| Rendered clients/show.html.erb within layouts/application (78.7ms) | |
| Completed 200 OK in 100ms (Views: 83.0ms | ActiveRecord: 0.7ms) | |
| Started GET "/clients/1/people/new" for 127.0.0.1 at 2010-10-09 21:11:12 -0400 | |
| Processing by PeopleController#new as HTML | |
| Parameters: {"client_id"=>"1"} | |
| Client Load (0.3ms) SELECT `clients`.* FROM `clients` WHERE (`clients`.`id` = 1) LIMIT 1 | |
| Rendered people/_form.html.erb (21.8ms) | |
| Rendered people/new.html.erb within layouts/application (26.1ms) | |
| Completed 200 OK in 95ms (Views: 31.4ms | ActiveRecord: 0.3ms) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment