diff --git a/lib/generators/tailwindcss/authentication/authentication_generator.rb b/lib/generators/tailwindcss/authentication/authentication_generator.rb index aa6fc23..220a2fa 100644 --- a/lib/generators/tailwindcss/authentication/authentication_generator.rb +++ b/lib/generators/tailwindcss/authentication/authentication_generator.rb @@ -4,6 +4,10 @@ module Tailwindcss module Generators class AuthenticationGenerator < Erb::Generators::AuthenticationGenerator source_root File.expand_path("templates", __dir__) + + def copy_view_files + template "../../scaffold/templates/_flashes.html.erb", "app/views/application/_flashes.html.erb" + end end end end diff --git a/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb b/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb index 707bbe5..57e4fcc 100644 --- a/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb +++ b/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb @@ -1,7 +1,5 @@
<%%= alert %>
- <%% end %> + <%%= render "flashes" %><%%= alert %>
- <%% end %> + <%%= render "flashes" %><%%= alert %>
- <%% end %> - - <%% if notice = flash[:notice] %> -<%%= notice %>
- <%% end %> + <%%= render "flashes" %><%%= notice %>
+<%% end %> + +<%% if alert.present? %> +<%%= alert %>
+<%% end %> diff --git a/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt index 3d337f9..2b245cf 100644 --- a/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt @@ -1,9 +1,7 @@ <%% content_for :title, "<%= human_name.pluralize %>" %><%%= notice %>
- <%% end %> + <%%= render "flashes" %><%%= notice %>
- <%% end %> + <%%= render "flashes" %>