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 707bbe5c..57e4fcc4 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 %> + <%%= render "flashes" %><%%= notice %>
- <%% end %> + <%%= render "flashes" %><%= notice %>
+<% end %> + +<% if alert.present? %> +<%= alert %>
+<% end %> diff --git a/lib/install/tailwindcss.rb b/lib/install/tailwindcss.rb index 2c2ba50c..db5dcb05 100644 --- a/lib/install/tailwindcss.rb +++ b/lib/install/tailwindcss.rb @@ -38,6 +38,12 @@ copy_file "#{__dir__}/application.tailwind.css", "app/assets/stylesheets/application.tailwind.css" end +empty_directory "app/views/application" +unless Rails.root.join("app/views/application/_flashes.html.erb").exist? + say "Add default app/views/application/_flashes.html.erb" + copy_file "#{__dir__}/_flashes.html.erb", "app/views/application/_flashes.html.erb" +end + if Rails.root.join("Procfile.dev").exist? append_to_file "Procfile.dev", "css: bin/rails tailwindcss:watch\n" else