tarellel / tailwind_views_generator

A Rails generator for creating Tailwind styled views (Erb, Slim, and HAML).
MIT License
4 stars 1 forks source link

generator is looking in the wrong place for templates #1

Open martindemello opened 2 years ago

martindemello commented 2 years ago
$ bin/rails g tailwind_views:install --devise -t erb
Could not find "scaffolds/tailwindcss/edit.html.tailwindcss" in any of your source paths. Your current source paths are: 
/home/mdemello/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/tailwind_views_generator-0.0.3/lib/templates

looks like the -t argument is not getting stored in options - adding a p options in the install method give me:

{"skip_namespace"=>false, "skip_collision_check"=>false, "template_engine"=>:tailwindcss, "devise"=>true, "layout"=>false, "metatags"=>false, "pagination"=>false, "simpleform"=>false, "skip_javascript"=>false, "skip_turbolinks"=>false}
tarellel commented 2 years ago

I'm honestly curious, in your application what version of Rails you running this generator in?

I ask, because I'm unable to reproduce this and am able to run the generator in Rails 7.0, 6.1, and 6.0 with the command you supplied. bin/rails g tailwind_views:install --devise -t erb

Ruby3.0.3/Rails 7.0.2 (I also tried 3.0.2 in which appears that you are running) Ruby2.7/Rails 6.1 Ruby2.7/Rails6.0

Screen Shot 2022-03-06 at 8 50 28 AM

I'm wondering if this happens to be an issue caused by an older version of thor where aliases has issues, because my output for options appears to be valid.

Screen Shot 2022-03-06 at 8 57 18 AM
martindemello commented 2 years ago
$ rails --version
Rails 7.0.2.2

$ gem list thor

*** LOCAL GEMS ***

thor (1.2.1)

i'll poke at it if you cannot reproduce.

martindemello commented 2 years ago

it seems to be a conflict with tailwindcss-rails; if i start a new project without that the bug goes away.