diff --git a/lib/generators/draft/resource/templates/views/association_new_form.html.erb b/lib/generators/draft/resource/templates/views/association_new_form.html.erb index 26cdfe6..b089dce 100644 --- a/lib/generators/draft/resource/templates/views/association_new_form.html.erb +++ b/lib/generators/draft/resource/templates/views/association_new_form.html.erb @@ -19,20 +19,20 @@ <% end -%> <% elsif attribute.field_type == :check_box -%> -
+
<% if with_sentinels? -%> <% end -%> - <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%>> + <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%>> <% if with_sentinels? -%> <% end -%>
<% else -%> -
+
@@ -41,7 +41,7 @@ <% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> @@ -49,7 +49,7 @@ <% if with_sentinels? -%> <% end -%> - value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"<% end -%>> + value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"<% end -%>> <% if with_sentinels? -%> <% end -%> @@ -61,7 +61,7 @@ <% end -%> <% end -%> - diff --git a/lib/generators/draft/resource/templates/views/edit_form.html.erb b/lib/generators/draft/resource/templates/views/edit_form.html.erb index 4b29fac..ee86d0e 100644 --- a/lib/generators/draft/resource/templates/views/edit_form.html.erb +++ b/lib/generators/draft/resource/templates/views/edit_form.html.erb @@ -17,21 +17,21 @@ <% end -%> <% if attribute.field_type == :check_box -%> -
+
<% if with_sentinels? -%> <% end -%> - .<%= attribute.column_name %> %>> + .<%= attribute.column_name %> %>> <% if with_sentinels? -%> <% end -%> -
<% else -%> -
+
@@ -40,7 +40,7 @@ <% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> @@ -48,7 +48,7 @@ <% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> @@ -60,7 +60,7 @@ <% end -%> <% end -%> - diff --git a/lib/generators/draft/resource/templates/views/edit_form_with_errors.html.erb b/lib/generators/draft/resource/templates/views/edit_form_with_errors.html.erb index 1f63ca0..1e3053f 100644 --- a/lib/generators/draft/resource/templates/views/edit_form_with_errors.html.erb +++ b/lib/generators/draft/resource/templates/views/edit_form_with_errors.html.erb @@ -4,7 +4,7 @@ <% end -%> <%% if @<%= singular_table_name %>.errors.any? %> <%% @<%= singular_table_name %>.errors.full_messages.each do |message| %> -
+
<%%= message %>
<%% end %> @@ -30,21 +30,21 @@ <% end -%> <% if attribute.field_type == :check_box -%> -
+
<% if with_sentinels? -%> <% end -%> - .<%= attribute.column_name %> %>> + .<%= attribute.column_name %> %>> <% if with_sentinels? -%> <% end -%> -
<% else -%> -
+
@@ -53,7 +53,7 @@ <% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> @@ -61,7 +61,7 @@ <% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> @@ -73,7 +73,7 @@ <% end -%> <% end -%> - diff --git a/lib/generators/draft/resource/templates/views/index.html.erb b/lib/generators/draft/resource/templates/views/index.html.erb index bd5af77..b153d82 100644 --- a/lib/generators/draft/resource/templates/views/index.html.erb +++ b/lib/generators/draft/resource/templates/views/index.html.erb @@ -1,5 +1,5 @@ -
-
+
+

List of all <%= plural_table_name.humanize.downcase %>

@@ -8,8 +8,8 @@
-
-
+
+

Add a new <%= singular_table_name.humanize.downcase %>

@@ -17,36 +17,36 @@
method="post"<% end -%>> <% attributes.each do |attribute| -%> <% if attribute.field_type == :check_box -%> -
- +
+ - +
<% else -%> -
+
<% if attribute.field_type == :text_area -%> - + <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :datetime -%> - + <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :date -%> - + <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :time -%> - + <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :integer -%> - + <% else -%> - + <% end -%>
<% end -%> <% end -%> - @@ -66,9 +66,9 @@
<% end -%> -
-
- +
+
+
ID diff --git a/lib/generators/draft/resource/templates/views/new_form.html.erb b/lib/generators/draft/resource/templates/views/new_form.html.erb index 1d81d37..02563aa 100644 --- a/lib/generators/draft/resource/templates/views/new_form.html.erb +++ b/lib/generators/draft/resource/templates/views/new_form.html.erb @@ -18,21 +18,21 @@ <% end -%> <% if attribute.field_type == :check_box -%> -
+
<% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> -
<% else -%> -
+
@@ -41,7 +41,7 @@ <% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> @@ -49,7 +49,7 @@ <% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> @@ -61,7 +61,7 @@ <% end -%> <% end -%> - diff --git a/lib/generators/draft/resource/templates/views/new_form_with_errors.html.erb b/lib/generators/draft/resource/templates/views/new_form_with_errors.html.erb index cb6232b..330a775 100644 --- a/lib/generators/draft/resource/templates/views/new_form_with_errors.html.erb +++ b/lib/generators/draft/resource/templates/views/new_form_with_errors.html.erb @@ -3,7 +3,7 @@ <%% if @<%= singular_table_name %>.present? %> <%% if @<%= singular_table_name %>.errors.any? %> <%% @<%= singular_table_name %>.errors.full_messages.each do |message| %> -
+
<%%= message %>
<%% end %> @@ -31,21 +31,21 @@ <% end -%> <% if attribute.field_type == :check_box -%> -
+
<% if with_sentinels? -%> <% end -%> - <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%>> + <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%>> <% if with_sentinels? -%> <% end -%> -
<% else -%> -
+
@@ -54,7 +54,7 @@ <% if with_sentinels? -%> <% end -%> - + <% if with_sentinels? -%> <% end -%> @@ -62,7 +62,7 @@ <% if with_sentinels? -%> <% end -%> - value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"<% end -%>> + value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"<% end -%>> <% if with_sentinels? -%> <% end -%> @@ -74,7 +74,7 @@ <% end -%> <% end -%> - diff --git a/lib/generators/draft/resource/templates/views/show.html.erb b/lib/generators/draft/resource/templates/views/show.html.erb index 7496c6d..b1c8aac 100644 --- a/lib/generators/draft/resource/templates/views/show.html.erb +++ b/lib/generators/draft/resource/templates/views/show.html.erb @@ -1,12 +1,12 @@ -
-
+
+

<%= singular_table_name.humanize %> #<%%= @the_<%= singular_table_name %>.id %> details

-
-
- +
+ @@ -15,8 +15,8 @@ <% if with_sentinels? -%> <% end -%> -
- + @@ -79,8 +79,8 @@ <% end -%> -
-
+
+

Edit <%= singular_table_name.humanize.downcase %>

@@ -88,38 +88,39 @@
method="post" <% end -%>> <% attributes.each do |attribute| -%> <% if attribute.field_type == :check_box -%> -
- .<%= attribute.column_name %> %>> +
+ .<%= attribute.column_name %> %>> - +
<% else -%> -
+
<% if attribute.field_type == :text_area -%> - + <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :datetime -%> + value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"> <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :date -%> - + <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :time -%> - + <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :integer -%> - + <% else -%> - + <% end -%>
<% end -%> <% end -%> -