Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined local variable or method `component_name' #158

Open
rastersysteme opened this issue Dec 4, 2019 · 1 comment · May be fixed by #159
Open

undefined local variable or method `component_name' #158

rastersysteme opened this issue Dec 4, 2019 · 1 comment · May be fixed by #159

Comments

@rastersysteme
Copy link

Version: 3.0.0.beta1

After doing:

rails generate komponent:install
rails generate komponent:styleguide
rails generate komponent:examples

I get the following error:

…/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/komponent-3.0.0.beta1/lib/generators/component/templates/examples.html.haml.erb:1:in `template': undefined local variable or method `component_name' for #<Komponent::Generators::ExamplesGenerator:0x00007f8a51bc7108> (NameError)
Did you mean?  @component_name
               component_path

Have a look at examples.html.haml.erb:

%h1 <%= @component_name %>

= cdoc "<%= component_name %>"

There’s a missing @ (same with .slim and .erb files). After using it, everything works fine.

@Spone
Copy link
Collaborator

Spone commented Dec 10, 2019

You're right! Would you mind contributing a PR to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants