drapergem / draper

Decorators/View-Models for Rails Applications
MIT License
5.23k stars 527 forks source link

Generators don't work. #890

Closed opsaaaaa closed 4 years ago

opsaaaaa commented 4 years ago

I created a fresh rails project. I was following the readme while adding some decorators.

Generators To create an ApplicationDecorator that all generated decorators inherit from, run...

rails generate draper:install When you have Draper installed and generate a controller... .....

rails generate decorator Article ...to create the ArticleDecorator.

for rails generate decorator Article I get

Could not find generator 'decorator'. 

and basically the same message for rails generate draper:install

I created a decorator manually and it seems to work fine. just the generators that don't work.

Is this feature currently broken or have the generators been deprecated or am I missing something?

lxxxvi commented 4 years ago

Hello @opsaaaaa 👋

This sounds like the gem has not been bundled. Make sure the gem is added to Gemfile and then run bundle install. The generators should work after that.

opsaaaaa commented 4 years ago

@lxxxvi, Thank you but I am not a noob. Yes I remembered to install the gem.

Everything but the generators work. I have 7 decorators that run fine. The gem is installed and working.

opsaaaaa commented 4 years ago

I just created a new rails app with draper install and the generators work. Apparently they also now work in the initial app I was using. I don't know what happened, maybe it was something stupid like forgetting to bundle install @lxxxvi I'll Close this issue now.