Skip to content

Instantly share code, notes, and snippets.

@andrewhl
Created April 10, 2012 16:10
Show Gist options
  • Save andrewhl/2352492 to your computer and use it in GitHub Desktop.
Save andrewhl/2352492 to your computer and use it in GitHub Desktop.
class AspRegistrationsController < ApplicationController
def create
end
def update
end
def new
@registration = AspRegistration.new
@programs = AfterSchoolProgram.all
end
def show
# @registrations = AspRegistration.find_all_by_id(params[:id])
end
def destroy
end
end
<% provide :title, 'After School Programs Registration Form' %>
<h2>Sign up for After School Programs</h2>
<% @programs.each do |program| %>
<td><%= program.program_name %></td>
<% end %>
<%= form_for(@registration) do |f| %>
<table class="actions">
<% @programs.each do |program| %>
<tr>
<td><%= program.program_name %></td>
<% current_user.children.each do |child| %>
<td><%= f.check_box "child", "#{child.first_name}" %></td>
<% end %>
</tr>
<% end %>
<%= f.submit "Sign up" %>
</table>
<% end %>
<hr>
<h2>Your children</h2>
<table>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Health card</th>
<th>Medical</th>
<th>Grade</th>
<th>Child class</th>
<th>Campus</th>
<th>Emerg. Contact 1st Name</th>
<th>Emerg. Contact Last Name</th>
<th>Emergency Phone #</th>
<th>Shoe size</th>
</tr>
<% current_user.children.each do |child| %>
<tr>
<td><%= child.first_name %></td>
<td><%= child.last_name %></td>
<td><%= child.health_card %></td>
<td><%= child.medical %></td>
<td><%= child.grade %></td>
<td><%= child.child_class %></td>
<td><%= child.campus %></td>
<td><%= child.emergency_first_name %></td>
<td><%= child.emergency_last_name %></td>
<td><%= child.emergency_phone %></td>
<td><%= child.shoe_size %></td>
</tr>
<% end %>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment