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

Rails/HelperInstanceVariable should not complain about usage of the @template instance variable #404

Closed
Ecco opened this issue Dec 9, 2020 · 0 comments · Fixed by #407
Closed

Comments

@Ecco
Copy link

Ecco commented Dec 9, 2020

Expected behavior

When writing a custom FormBuilder, you're supposed to use the @template instance variable. This is even shown in the Rails API's example.

Actual behavior

The folder app/helpers also seems like the right location to put a custom FormBuilder.

But the RuboCop Rails will complain about usage of @template.

RuboCop version

1.5.2 (using Parser 2.7.2.0, rubocop-ast 1.3.0, running on ruby 2.6.6 x86_64-darwin20)
  - rubocop-rails 2.9.0
koic added a commit to koic/rubocop-rails that referenced this issue Dec 11, 2020
…nce variables

Fixes rubocop#404.

This PR makes `Rails/HelperInstanceVariable` accept of instance variables
when class inherited `ActionView::Helpers::FormBuilder`.

It may be too broad to accept all instance variables, but view helper and
form builder have different uses, so let's take a look first.
koic added a commit to koic/rubocop-rails that referenced this issue Dec 11, 2020
…nce variables

Fixes rubocop#404.

This PR makes `Rails/HelperInstanceVariable` accept of instance variables
when class inherited `ActionView::Helpers::FormBuilder`.

It may be too broad to accept all instance variables, but view helper and
form builder have different uses, so let's take a look first.
koic added a commit to koic/rubocop-rails that referenced this issue Dec 11, 2020
…nce variables

Fixes rubocop#404.

This PR makes `Rails/HelperInstanceVariable` accept of instance variables
when class inherited `ActionView::Helpers::FormBuilder`.

It may be too broad to accept all instance variables, but view helper and
form builder have different uses, so let's take a look first.
koic added a commit to koic/rubocop-rails that referenced this issue Dec 12, 2020
…nce variables

Fixes rubocop#404.

This PR makes `Rails/HelperInstanceVariable` accept of instance variables
when class inherited `ActionView::Helpers::FormBuilder`.

It may be too broad to accept all instance variables, but view helper and
form builder have different uses, so let's take a look first.
@koic koic closed this as completed in #407 Dec 14, 2020
koic added a commit that referenced this issue Dec 14, 2020
…_accept_of_ivar

[Fix #404] Make `Rails/HelperInstanceVariable` accept of instance variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant