From e48dc287ddc24396c31ebd1c0999a5ebbb6e567f Mon Sep 17 00:00:00 2001 From: BakiVernes Date: Fri, 20 Aug 2021 13:57:48 +0200 Subject: [PATCH 1/4] Add Tailwind styled scaffold templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dino Marić --- lib/install/tailwindcss.rb | 4 +- lib/tailwindcss/engine.rb | 4 ++ lib/templates/erb/scaffold/_form.html.erb.tt | 43 ++++++++++++++++++++ lib/templates/erb/scaffold/edit.html.erb.tt | 8 ++++ lib/templates/erb/scaffold/index.html.erb.tt | 32 +++++++++++++++ lib/templates/erb/scaffold/new.html.erb.tt | 7 ++++ lib/templates/erb/scaffold/show.html.erb.tt | 20 +++++++++ 7 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 lib/templates/erb/scaffold/_form.html.erb.tt create mode 100644 lib/templates/erb/scaffold/edit.html.erb.tt create mode 100644 lib/templates/erb/scaffold/index.html.erb.tt create mode 100644 lib/templates/erb/scaffold/new.html.erb.tt create mode 100644 lib/templates/erb/scaffold/show.html.erb.tt diff --git a/lib/install/tailwindcss.rb b/lib/install/tailwindcss.rb index c903fc54..97666284 100644 --- a/lib/install/tailwindcss.rb +++ b/lib/install/tailwindcss.rb @@ -1,11 +1,13 @@ APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb") if APPLICATION_LAYOUT_PATH.exist? - say "Add Tailwindcss include tags in application layout" + say "Add Tailwindcss include tags and container element in application layout" insert_into_file APPLICATION_LAYOUT_PATH.to_s, <<~ERB.indent(4), before: /^\s*<%= stylesheet_link_tag/ <%= stylesheet_link_tag "inter-font", "data-turbo-track": "reload" %> <%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %> ERB + insert_into_file APPLICATION_LAYOUT_PATH.to_s, %(
\n ), before: /^\s*<%= yield/ + insert_into_file APPLICATION_LAYOUT_PATH.to_s, %(\n
), after: /^\s*<%= yield %>/ else say "Default application.html.erb is missing!", :red say %( Add <%= stylesheet_link_tag "inter-font", "data-turbo-track": "reload" %> and <%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %> within the tag in your custom layout.) diff --git a/lib/tailwindcss/engine.rb b/lib/tailwindcss/engine.rb index d46f5850..22a25763 100644 --- a/lib/tailwindcss/engine.rb +++ b/lib/tailwindcss/engine.rb @@ -19,5 +19,9 @@ class Engine < ::Rails::Engine env.cache = ActiveSupport::Cache.lookup_store(:null_store) end if Rails.env.production? end + + config.app_generators do |g| + g.templates.unshift File::expand_path('../../templates', __FILE__) + end end end diff --git a/lib/templates/erb/scaffold/_form.html.erb.tt b/lib/templates/erb/scaffold/_form.html.erb.tt new file mode 100644 index 00000000..d608cbfd --- /dev/null +++ b/lib/templates/erb/scaffold/_form.html.erb.tt @@ -0,0 +1,43 @@ +<%%= form_with(model: <%= model_resource_name %>, class: "contents") do |form| %> + <%% if <%= singular_table_name %>.errors.any? %> +
+

<%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:

+ +
    + <%% <%= singular_table_name %>.errors.each do |error| %> +
  • <%%= error.full_message %>
  • + <%% end %> +
+
+ <%% end %> + +<% attributes.each do |attribute| -%> +
+<% if attribute.password_digest? -%> + <%%= form.label :password %> + <%%= form.password_field :password %> +
+ +
+ <%%= form.label :password_confirmation %> + <%%= form.password_field :password_confirmation, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %> +<% elsif attribute.attachments? -%> + <%%= form.label :<%= attribute.column_name %> %> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %> +<% else -%> + <%%= form.label :<%= attribute.column_name %> %> +<% if attribute.field_type == :text_area -%> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %> +<% elsif attribute.field_type == :check_box -%> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block mt-2 h-5 w-5" %> +<% else -%> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %> +<% end -%> +<% end -%> +
+ +<% end -%> +
+ <%%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium" %> +
+<%% end %> \ No newline at end of file diff --git a/lib/templates/erb/scaffold/edit.html.erb.tt b/lib/templates/erb/scaffold/edit.html.erb.tt new file mode 100644 index 00000000..97b82467 --- /dev/null +++ b/lib/templates/erb/scaffold/edit.html.erb.tt @@ -0,0 +1,8 @@ +
+

Editing <%= human_name.downcase %>

+ + <%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %> + + <%%= link_to "Show this <%= human_name.downcase %>", @<%= singular_table_name %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> +
\ No newline at end of file diff --git a/lib/templates/erb/scaffold/index.html.erb.tt b/lib/templates/erb/scaffold/index.html.erb.tt new file mode 100644 index 00000000..b2efc066 --- /dev/null +++ b/lib/templates/erb/scaffold/index.html.erb.tt @@ -0,0 +1,32 @@ +
+ <%% if notice.present? %> +

<%%= notice %>

+ <%% end %> + +
+

<%= human_name %>

+ <%%= link_to 'New <%= human_name.downcase %>', new_<%= singular_route_name %>_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %> +
+ + + + +<% attributes.reject(&:password_digest?).each do |attribute| -%> + +<% end -%> + + + + + <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> + +<% attributes.reject(&:password_digest?).each do |attribute| -%> + +<% end -%> + + + + <%% end %> + +
<%= attribute.human_name %>
<%%= <%= singular_table_name %>.<%= attribute.column_name %> %><%%= link_to 'Show', <%= model_resource_name %>, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %><%%= link_to 'Edit', edit_<%= singular_route_name %>_path(<%= singular_table_name %>), class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
+
diff --git a/lib/templates/erb/scaffold/new.html.erb.tt b/lib/templates/erb/scaffold/new.html.erb.tt new file mode 100644 index 00000000..e903183b --- /dev/null +++ b/lib/templates/erb/scaffold/new.html.erb.tt @@ -0,0 +1,7 @@ +
+

New <%= human_name.downcase %>

+ + <%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %> + + <%%= link_to 'Back to <%= human_name.pluralize.downcase %>', <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> +
\ No newline at end of file diff --git a/lib/templates/erb/scaffold/show.html.erb.tt b/lib/templates/erb/scaffold/show.html.erb.tt new file mode 100644 index 00000000..cef9dd5a --- /dev/null +++ b/lib/templates/erb/scaffold/show.html.erb.tt @@ -0,0 +1,20 @@ +
+
+ <%% if notice.present? %> +

<%%= notice %>

+ <%% end %> + +<% attributes.reject(&:password_digest?).each do |attribute| -%> +

+ <%= attribute.human_name %>: + <%%= @<%= singular_table_name %>.<%= attribute.column_name %> %> +

+<% end -%> + + <%%= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> +
+ <%%= button_to 'Delete', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %> +
+ <%%= link_to 'Back', <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> +
+
From bfb324a3201a2a69e2ee15b8fe719d66459ff76a Mon Sep 17 00:00:00 2001 From: BakiVernes Date: Sun, 12 Sep 2021 19:32:29 +0200 Subject: [PATCH 2/4] Match templates to rails main branch --- lib/templates/erb/scaffold/_form.html.erb.tt | 8 +++--- lib/templates/erb/scaffold/index.html.erb.tt | 26 +++---------------- .../erb/scaffold/partial.html.erb.tt | 22 ++++++++++++++++ lib/templates/erb/scaffold/show.html.erb.tt | 13 +++------- 4 files changed, 34 insertions(+), 35 deletions(-) create mode 100644 lib/templates/erb/scaffold/partial.html.erb.tt diff --git a/lib/templates/erb/scaffold/_form.html.erb.tt b/lib/templates/erb/scaffold/_form.html.erb.tt index d608cbfd..a6d0dea1 100644 --- a/lib/templates/erb/scaffold/_form.html.erb.tt +++ b/lib/templates/erb/scaffold/_form.html.erb.tt @@ -12,13 +12,13 @@ <%% end %> <% attributes.each do |attribute| -%> -
+
<% if attribute.password_digest? -%> <%%= form.label :password %> <%%= form.password_field :password %>
-
+
<%%= form.label :password_confirmation %> <%%= form.password_field :password_confirmation, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %> <% elsif attribute.attachments? -%> @@ -37,7 +37,7 @@
<% end -%> -
+
<%%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium" %>
-<%% end %> \ No newline at end of file +<%% end %> diff --git a/lib/templates/erb/scaffold/index.html.erb.tt b/lib/templates/erb/scaffold/index.html.erb.tt index b2efc066..e5aee531 100644 --- a/lib/templates/erb/scaffold/index.html.erb.tt +++ b/lib/templates/erb/scaffold/index.html.erb.tt @@ -4,29 +4,11 @@ <%% end %>
-

<%= human_name %>

+

<%= human_name.pluralize %>

<%%= link_to 'New <%= human_name.downcase %>', new_<%= singular_route_name %>_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
- - - -<% attributes.reject(&:password_digest?).each do |attribute| -%> - -<% end -%> - - - - - <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> - -<% attributes.reject(&:password_digest?).each do |attribute| -%> - -<% end -%> - - - - <%% end %> - -
<%= attribute.human_name %>
<%%= <%= singular_table_name %>.<%= attribute.column_name %> %><%%= link_to 'Show', <%= model_resource_name %>, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %><%%= link_to 'Edit', edit_<%= singular_route_name %>_path(<%= singular_table_name %>), class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
+
+ <%%= render @<%= plural_table_name %> %> +
diff --git a/lib/templates/erb/scaffold/partial.html.erb.tt b/lib/templates/erb/scaffold/partial.html.erb.tt new file mode 100644 index 00000000..6564a92c --- /dev/null +++ b/lib/templates/erb/scaffold/partial.html.erb.tt @@ -0,0 +1,22 @@ +
+<% attributes.reject(&:password_digest?).each do |attribute| -%> +

+ <%= attribute.human_name %>: +<% if attribute.attachment? -%> + <%%= link_to <%= singular_table_name %>.<%= attribute.column_name %>.filename, <%= singular_table_name %>.<%= attribute.column_name %> if <%= singular_table_name %>.<%= attribute.column_name %>.attached? %> +<% elsif attribute.attachments? -%> + <%% <%= singular_table_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %> +

<%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %>
+ <%% end %> +<% else -%> + <%%= <%= singular_table_name %>.<%= attribute.column_name %> %> +<% end -%> +

+ +<% end -%> + <%% if action_name != "show" %> + <%%= link_to "Show this <%= human_name.downcase %>", <%= singular_table_name %>, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%%= link_to 'Edit this <%= human_name.downcase %>', edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %> +
+ <%% end %> +
\ No newline at end of file diff --git a/lib/templates/erb/scaffold/show.html.erb.tt b/lib/templates/erb/scaffold/show.html.erb.tt index cef9dd5a..57ff9514 100644 --- a/lib/templates/erb/scaffold/show.html.erb.tt +++ b/lib/templates/erb/scaffold/show.html.erb.tt @@ -4,17 +4,12 @@

<%%= notice %>

<%% end %> -<% attributes.reject(&:password_digest?).each do |attribute| -%> -

- <%= attribute.human_name %>: - <%%= @<%= singular_table_name %>.<%= attribute.column_name %> %> -

-<% end -%> + <%%= render @<%= singular_table_name %> %> - <%%= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%%= link_to 'Edit this <%= singular_table_name %>', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
- <%%= button_to 'Delete', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %> + <%%= button_to 'Delete this <%= singular_table_name %>', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, data: { confirm: "Are you sure you want to delete this <%= singular_table_name %>?" }, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
- <%%= link_to 'Back', <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%%= link_to 'Back to <%= plural_table_name %>', <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
From f14aa08d0b5f6c4b883665e31f19be0346fad00c Mon Sep 17 00:00:00 2001 From: Dino Maric Date: Mon, 13 Sep 2021 18:26:41 +0200 Subject: [PATCH 3/4] Support Rails 6 Add custom scaffold generator that is same as the one inside the Rails 7 in order to make this work with Rails 6. --- .gitignore | 3 +- .../scaffold/scaffold_generator.rb | 34 +++++++++++++++++++ .../scaffold/templates}/_form.html.erb.tt | 0 .../scaffold/templates}/edit.html.erb.tt | 2 +- .../scaffold/templates}/index.html.erb.tt | 0 .../scaffold/templates}/new.html.erb.tt | 2 +- .../scaffold/templates}/partial.html.erb.tt | 2 +- .../scaffold/templates}/show.html.erb.tt | 0 lib/tailwindcss/engine.rb | 7 ++-- .../tailwindcss/scaffold_generator_test.rb | 21 ++++++++++++ test/test_helper.rb | 2 +- 11 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 lib/generators/tailwindcss/scaffold/scaffold_generator.rb rename lib/{templates/erb/scaffold => generators/tailwindcss/scaffold/templates}/_form.html.erb.tt (100%) rename lib/{templates/erb/scaffold => generators/tailwindcss/scaffold/templates}/edit.html.erb.tt (98%) rename lib/{templates/erb/scaffold => generators/tailwindcss/scaffold/templates}/index.html.erb.tt (100%) rename lib/{templates/erb/scaffold => generators/tailwindcss/scaffold/templates}/new.html.erb.tt (98%) rename lib/{templates/erb/scaffold => generators/tailwindcss/scaffold/templates}/partial.html.erb.tt (99%) rename lib/{templates/erb/scaffold => generators/tailwindcss/scaffold/templates}/show.html.erb.tt (100%) create mode 100644 test/lib/generators/tailwindcss/scaffold_generator_test.rb diff --git a/.gitignore b/.gitignore index 62527ab3..f1417ac5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ /node_modules .byebug_history *.gem -.idea/ \ No newline at end of file +.idea/ +**/tmp/ \ No newline at end of file diff --git a/lib/generators/tailwindcss/scaffold/scaffold_generator.rb b/lib/generators/tailwindcss/scaffold/scaffold_generator.rb new file mode 100644 index 00000000..3ae3c99d --- /dev/null +++ b/lib/generators/tailwindcss/scaffold/scaffold_generator.rb @@ -0,0 +1,34 @@ +require 'rails/generators/erb/scaffold/scaffold_generator' +require "rails/generators/resource_helpers" + +module Tailwindcss + module Generators + class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator + include Rails::Generators::ResourceHelpers + + source_root File.expand_path("../templates", __FILE__) + + argument :attributes, type: :array, default: [], banner: "field:type field:type" + + def create_root_folder + empty_directory File.join("app/views", controller_file_path) + end + + def copy_view_files + available_views.each do |view| + formats.each do |format| + filename = filename_with_extensions(view, format) + template filename, File.join("app/views", controller_file_path, filename) + end + end + + template "partial.html.erb", File.join("app/views", controller_file_path, "_#{singular_table_name}.html.erb") + end + + private + def available_views + %w(index edit show new _form) + end + end + end +end \ No newline at end of file diff --git a/lib/templates/erb/scaffold/_form.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt similarity index 100% rename from lib/templates/erb/scaffold/_form.html.erb.tt rename to lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt diff --git a/lib/templates/erb/scaffold/edit.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt similarity index 98% rename from lib/templates/erb/scaffold/edit.html.erb.tt rename to lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt index 97b82467..34756518 100644 --- a/lib/templates/erb/scaffold/edit.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt @@ -5,4 +5,4 @@ <%%= link_to "Show this <%= human_name.downcase %>", @<%= singular_table_name %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> - \ No newline at end of file + diff --git a/lib/templates/erb/scaffold/index.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt similarity index 100% rename from lib/templates/erb/scaffold/index.html.erb.tt rename to lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt diff --git a/lib/templates/erb/scaffold/new.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt similarity index 98% rename from lib/templates/erb/scaffold/new.html.erb.tt rename to lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt index e903183b..3eed7024 100644 --- a/lib/templates/erb/scaffold/new.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt @@ -4,4 +4,4 @@ <%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %> <%%= link_to 'Back to <%= human_name.pluralize.downcase %>', <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> - \ No newline at end of file + diff --git a/lib/templates/erb/scaffold/partial.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt similarity index 99% rename from lib/templates/erb/scaffold/partial.html.erb.tt rename to lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt index 6564a92c..301d82f2 100644 --- a/lib/templates/erb/scaffold/partial.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt @@ -19,4 +19,4 @@ <%%= link_to 'Edit this <%= human_name.downcase %>', edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
<%% end %> - \ No newline at end of file + diff --git a/lib/templates/erb/scaffold/show.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt similarity index 100% rename from lib/templates/erb/scaffold/show.html.erb.tt rename to lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt diff --git a/lib/tailwindcss/engine.rb b/lib/tailwindcss/engine.rb index 22a25763..9dbdfd72 100644 --- a/lib/tailwindcss/engine.rb +++ b/lib/tailwindcss/engine.rb @@ -20,8 +20,9 @@ class Engine < ::Rails::Engine end if Rails.env.production? end - config.app_generators do |g| - g.templates.unshift File::expand_path('../../templates', __FILE__) - end + config.app_generators do |g| + #g.templates.unshift File::expand_path('../../templates', __FILE__) + g.template_engine :tailwindcss + end end end diff --git a/test/lib/generators/tailwindcss/scaffold_generator_test.rb b/test/lib/generators/tailwindcss/scaffold_generator_test.rb new file mode 100644 index 00000000..fd28851a --- /dev/null +++ b/test/lib/generators/tailwindcss/scaffold_generator_test.rb @@ -0,0 +1,21 @@ +require "test_helper" +require "generators/tailwindcss/scaffold/scaffold_generator" + +class Tailwindcss::Generators::ScaffoldGeneratorTest < Rails::Generators::TestCase + GENERATION_PATH = File.expand_path("../tmp", File.dirname(__FILE__)) + + tests Tailwindcss::Generators::ScaffoldGenerator + destination GENERATION_PATH + + arguments %w(message title:string content:text) + + Minitest.after_run do + FileUtils.rm_rf GENERATION_PATH + end + + test "generates correct view templates" do + run_generator + + %w(index edit new show _form _message).each { |view| assert_file "app/views/messages/#{view}.html.erb" } + end +end \ No newline at end of file diff --git a/test/test_helper.rb b/test/test_helper.rb index d7a01c0d..8e127805 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -7,5 +7,5 @@ require_relative "../lib/tailwindcss-rails" require "rails/test_unit/reporter" -Rails::TestUnitReporter.executable = 'bin/test' +Rails::TestUnitReporter.executable = "bin/test" From 9c5aaa38086beffc5b423e312d3236ef91f049c4 Mon Sep 17 00:00:00 2001 From: Dino Maric Date: Mon, 13 Sep 2021 21:03:41 +0200 Subject: [PATCH 4/4] Remove commented out code from engine.rb --- lib/tailwindcss/engine.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/tailwindcss/engine.rb b/lib/tailwindcss/engine.rb index 9dbdfd72..9329dbbd 100644 --- a/lib/tailwindcss/engine.rb +++ b/lib/tailwindcss/engine.rb @@ -21,7 +21,6 @@ class Engine < ::Rails::Engine end config.app_generators do |g| - #g.templates.unshift File::expand_path('../../templates', __FILE__) g.template_engine :tailwindcss end end