werein / x-editable-rails

Edit fields easily with X-Editable helper

Home Page:https://wereinhq.com/guides/x-editable-rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NoMethodError: undefined method `editable' in production environment

dgilperez opened this issue · comments

Hi!

I've installed x-editable-rails in my app, everything is working as expected in development environment but it fails in production. editable method is not found.

I'm quite confused about this error, any ideas or hints to debug it?

Many thanks and happy new year!

Hmmm I worked around this issue by adding an initializer to my app:

# config/initializers/x-editable-rails.rb
require 'x-editable-rails/version'
require 'x-editable-rails/configuration'
require 'x-editable-rails/view_helpers'
ActionView::Base.send :include, X::Editable::Rails::ViewHelpers

Weird. This is only needed for production environments, developement will work with no issue.

Btw, I'm on Ruby 2.0 and Rails 3.2.16

That's weird. Don't you have gem 'x-editable-rails' in group: :development block accidentally? It's working fine, even in Rails Engine, with require 'x-editable-rails' of course.

But I didn't tested it on Rails 3.2