Skip to content

Instantly share code, notes, and snippets.

@leadhkr
Created April 27, 2015 03:45
Show Gist options
  • Save leadhkr/ffd06a29416693702702 to your computer and use it in GitHub Desktop.
Save leadhkr/ffd06a29416693702702 to your computer and use it in GitHub Desktop.
<h1>Add Activity</h1>
<%= form_for @activity do |f| %>
<%= f.label :name, "Activity Name" %></br>
<%= f.text_field :name %></br>
<%= f.label :address_one, "Address 1" %></br>
<%= f.text_field :address_one %></br>
<%= f.label :address_two, "Address 2" %></br>
<%= f.text_field :address_two %></br>
<%= f.label :city, "City" %></br>
<%= f.text_field :city %></br>
<%= f.label :state, "State" %></br>
<%= f.text_field :state %></br>
<%= f.label :zip_code, "Zip Code" %></br>
<%= f.text_field :zip_code %></br>
<%= f.label :description, "Description" %></br>
<%= f.text_area :description %></br>
<%= render partial: "shared/categories" %></br>
<% Category.all.each do |category| %>
<label>
<%= check_box_tag "activity[category_ids][]", category.id, @activity.categories.include?(category) %>
<%= category.category_name %></br>
</label>
<% end %>
<%= f.submit %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment