Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 70 lines (57 sloc) 1.986 kb
a422a51 @ryanb moving javascript :defaults include into form partial so they don't have...
ryanb authored
1 <% javascript :defaults %>
2
65f95b2 @ryanb initial import
ryanb authored
3 <%= error_messages_for :project %>
e397c44 @ryanb adding code from book
ryanb authored
4
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
5 <% form_for @project do |project_form| -%>
9f711f2 @alloy Toying with fields_for a has_many association and finding a way to have ...
authored
6
65f95b2 @ryanb initial import
ryanb authored
7 <p>
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
8 <%= project_form.label :name, "Project:" %>
9 <%= project_form.text_field :name %>
65f95b2 @ryanb initial import
ryanb authored
10 </p>
fbb7b9f @alloy Made NestedParamsFormBuilder work with a has_one association as well.
authored
11
12 <p>
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
13 <% project_form.fields_for :author do |author_form| %>
14 <%= author_form.label :name, "Author name:" %>
15 <%= author_form.text_field :name %>
ce66710 @alloy Added check boxes to the nested models which will make it raise an excep...
authored
16
17 <%= author_form.label :raise_exception, "Raise exception:" %>
18 <%= author_form.check_box :raise_exception %>
fbb7b9f @alloy Made NestedParamsFormBuilder work with a has_one association as well.
authored
19 <% end %>
20 </p>
21
e397c44 @ryanb adding code from book
ryanb authored
22 <div id="tasks">
d142946 @alloy Removed the second argument for the nested fields_for block and retrieve...
authored
23 <% project_form.fields_for :tasks do |task_form| %>
c664286 @alloy Demo the fields_for option of yielding for each record.
authored
24 <div class="task">
25 <p>
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
26 <%= task_form.label :name, "Task:" %>
27 <%= task_form.text_field :name %>
ce66710 @alloy Added check boxes to the nested models which will make it raise an excep...
authored
28
29 <%= task_form.label :raise_exception, "Raise exception:" %>
30 <%= task_form.check_box :raise_exception %>
31
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
32 <!-- Uses JS to hide this `task' and set a hidden_field with the name
33 `_delete' to "1" which causes the record to be deleted. -->
d142946 @alloy Removed the second argument for the nested fields_for block and retrieve...
authored
34 <%= remove_link_unless_new_record(task_form) %>
c664286 @alloy Demo the fields_for option of yielding for each record.
authored
35 </p>
36 </div>
37 <% end %>
e397c44 @ryanb adding code from book
ryanb authored
38 </div>
39 <p>
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
40 <%= add_task_link "Add a task", project_form %>
e397c44 @ryanb adding code from book
ryanb authored
41 </p>
e0ae3c9 @alloy Added Tag as a quick test of has_and_belongs_to_many with nested_params.
authored
42
43 <div id="tags">
d142946 @alloy Removed the second argument for the nested fields_for block and retrieve...
authored
44 <% project_form.fields_for :tags do |tag_form| %>
e0ae3c9 @alloy Added Tag as a quick test of has_and_belongs_to_many with nested_params.
authored
45 <div class="tag">
46 <p>
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
47 <%= tag_form.label :name, "Tag:" %>
48 <%= tag_form.text_field :name %>
49
ce66710 @alloy Added check boxes to the nested models which will make it raise an excep...
authored
50 <%= tag_form.label :raise_exception, "Raise exception:" %>
51 <%= tag_form.check_box :raise_exception %>
52
d142946 @alloy Removed the second argument for the nested fields_for block and retrieve...
authored
53 <% unless tag_form.object.new_record? %>
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
54 <!-- For existing records we add a checkbox to be able to delete records. -->
55 <%= tag_form.label :_delete, "Remove:" %>
56 <%= tag_form.check_box :_delete %>
57 <% end %>
e0ae3c9 @alloy Added Tag as a quick test of has_and_belongs_to_many with nested_params.
authored
58 </p>
59 </div>
60 <% end %>
61 </div>
62 <p>
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
63 <%= add_tag_link "Add a tag", project_form %>
e0ae3c9 @alloy Added Tag as a quick test of has_and_belongs_to_many with nested_params.
authored
64 </p>
65
e397c44 @ryanb adding code from book
ryanb authored
66 <p>
899b498 @alloy Added a checkbox which is used to delete tags instead of doing it with J...
authored
67 <%= project_form.submit "Submit" %>
e397c44 @ryanb adding code from book
ryanb authored
68 </p>
a422a51 @ryanb moving javascript :defaults include into form partial so they don't have...
ryanb authored
69 <% end -%>
Something went wrong with that request. Please try again.