amatsuda/active_decorator

Raise 「NameError: undefined local variable or method `view_context'」 when ActionController::API is inherited

Closed this issue · 2 comments

Steps to reproduce

This is reproduced Rails application.

  1. git clone git@github.com:taki/active_decorator_view_context.git
  2. cd active_decorator_view_context
  3. bundle install
  4. bin/rails db:setup
  5. bin/rails test

Expected behavior

It does not raise error.

Actual behavior

「NameError: undefined local variable or method `view_context'」 is displayed.

System configuration

  • Rails version 5.2.1
  • active_decorator 1.1.0

@Taki Just made 1.1.1 gem release hopefully with a fix for this issue based on @frodsan's patch. Thank you!

Thank you. It seems that it is still falling in a case in my application.
I will try to find time to reproduce minimiu error case or fix it.