Created
February 10, 2011 10:56
-
-
Save anonymous/820315 to your computer and use it in GitHub Desktop.
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
- nested_form_for(@exercise) do |f| | |
- if @exercise.errors.any? | |
#error_explanation | |
%h2 | |
= pluralize(@exercise.errors.count, "error") | |
prohibited this exercise from being saved: | |
%ul | |
- @exercise.errors.full_messages.each do |msg| | |
%li= msg | |
.field | |
= f.label :name | |
%br/ | |
= f.text_field :name | |
%p | |
%b Target(s): | |
- f.fields_for :muscles do |e| | |
= e.collection_select :id, Muscle.all, :id, :name | |
= e.link_to_remove "-remove" | |
= f.link_to_add "Add target muscle", :muscles | |
.field | |
= f.label :description | |
%br/ | |
= f.text_area :description | |
.field | |
= f.label :preparation | |
%br/ | |
= f.text_area :preparation | |
.field | |
= f.label :execution | |
%br/ | |
= f.text_area :execution | |
.field | |
= f.label :comment | |
%br/ | |
= f.text_area :comment | |
.field | |
= f.label :url | |
%br/ | |
= f.text_field :url | |
.field | |
= f.label :exercise_type | |
%br/ | |
= f.collection_select :exercise_type_id, ExerciseType.all, :id, :name | |
.actions | |
= f.submit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment