Создайте проблему, затем включите эту проблему в оба контроллера:
## app/controllers/concerns/concern_with_the_method_i_want.rb
module ConcernWithTheMethodIWant
def method
return 'This is the method'
end
end
class BaseController < ApplicationController
include ConcernWIthTheMethodIWant
end
class RegistrationController < Devise::RegistrationController
include ConcernWithTheMethodIWant
end
Это позволит вам сделать:
BaseController.new.method
=> 'This is the method'
Devise:RegistrationController.new.method
=> 'This is the method'