From 277f732fc9570a8b2081c5fb84c301ad4197f5e9 Mon Sep 17 00:00:00 2001 From: Pat McKernin Date: Thu, 3 Dec 2020 09:34:11 -0600 Subject: [PATCH 1/3] removed div's from update and show --- .../resource/templates/views/index.html.erb | 21 +++++----------- .../resource/templates/views/show.html.erb | 24 +++++++------------ 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/lib/generators/draft/resource/templates/views/index.html.erb b/lib/generators/draft/resource/templates/views/index.html.erb index b153d82..7688ebc 100644 --- a/lib/generators/draft/resource/templates/views/index.html.erb +++ b/lib/generators/draft/resource/templates/views/index.html.erb @@ -1,15 +1,10 @@ -
-
-

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

-
-
+

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

+
-
-

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

@@ -50,8 +45,7 @@ Create <%= singular_table_name.humanize.downcase %> -
-
+
<% if with_sentinels? -%> @@ -66,8 +60,7 @@
<% end -%> -
-
+ <%% end %>
@@ -142,7 +135,5 @@
-
-

diff --git a/lib/generators/draft/resource/templates/views/show.html.erb b/lib/generators/draft/resource/templates/views/show.html.erb index 1bddf31..2ba15ab 100644 --- a/lib/generators/draft/resource/templates/views/show.html.erb +++ b/lib/generators/draft/resource/templates/views/show.html.erb @@ -1,10 +1,9 @@ -
-
-

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

-
+

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

+ +
Go back @@ -24,7 +23,6 @@ <% end -%> <% end -%> -
<% attributes.each do |attribute| -%> @@ -68,8 +66,6 @@ <% end -%>
-
-

@@ -79,11 +75,9 @@ <% end -%> -
-
-

- Edit <%= singular_table_name.humanize.downcase %> -

+

+ Edit <%= singular_table_name.humanize.downcase %> +

method="post" <% end -%>> <% attributes.each do |attribute| -%> @@ -124,7 +118,5 @@ Update <%= singular_table_name.humanize.downcase %>
-
-

From 16a7f52b8439582e4c3e8efd0e3ab58a073d7447 Mon Sep 17 00:00:00 2001 From: Pat McKernin Date: Thu, 3 Dec 2020 09:45:38 -0600 Subject: [PATCH 2/3] edited force_sign_in comments --- lib/generators/draft/account/account_generator.rb | 3 ++- .../account/templates/controllers/authentication_controller.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/generators/draft/account/account_generator.rb b/lib/generators/draft/account/account_generator.rb index 45fda60..9c84e2f 100644 --- a/lib/generators/draft/account/account_generator.rb +++ b/lib/generators/draft/account/account_generator.rb @@ -91,7 +91,8 @@ def authentication_helpers before_action(:load_current_#{singular_table_name.underscore}) - # Uncomment this if you want to force #{plural_table_name} to sign in before any other actions + # Uncomment the "before_action" if you want to force #{plural_table_name} to sign in before any other actions + # Remember to also uncomment the "skip_before_action" in the corresponding account controller # before_action(:force_#{singular_table_name.underscore}_sign_in) def load_current_#{singular_table_name.underscore} diff --git a/lib/generators/draft/account/templates/controllers/authentication_controller.rb b/lib/generators/draft/account/templates/controllers/authentication_controller.rb index b91141e..f888a77 100644 --- a/lib/generators/draft/account/templates/controllers/authentication_controller.rb +++ b/lib/generators/draft/account/templates/controllers/authentication_controller.rb @@ -1,7 +1,8 @@ class <%= class_name.singularize %>AuthenticationController < ApplicationController # Uncomment this if you want to force <%= plural_table_name %> to sign in before any other actions # skip_before_action(:force_<%= singular_table_name.underscore %>_sign_in, { :only => [:sign_up_form, :create, :sign_in_form, :create_cookie] }) - + # Remember to also uncomment the "before_action" in the ApplicationController + def sign_in_form render({ :template => "<%= singular_table_name.underscore %>_authentication/sign_in.html.erb" }) end From 25c38bbcfc2d31fe0165dcd49e9caf2dd2be0b02 Mon Sep 17 00:00:00 2001 From: Pat McKernin Date: Thu, 3 Dec 2020 09:54:51 -0600 Subject: [PATCH 3/3] wording --- lib/generators/draft/account/account_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generators/draft/account/account_generator.rb b/lib/generators/draft/account/account_generator.rb index 9c84e2f..539515f 100644 --- a/lib/generators/draft/account/account_generator.rb +++ b/lib/generators/draft/account/account_generator.rb @@ -92,7 +92,7 @@ def authentication_helpers before_action(:load_current_#{singular_table_name.underscore}) # Uncomment the "before_action" if you want to force #{plural_table_name} to sign in before any other actions - # Remember to also uncomment the "skip_before_action" in the corresponding account controller + # Remember to also uncomment the "skip_before_action" in the corresponding authentication controller # before_action(:force_#{singular_table_name.underscore}_sign_in) def load_current_#{singular_table_name.underscore}