Im trying to render the default devise edit registrations view in a modal. The modal is being called from another controller.. Home_controller in this case.
I have <%= render :template, 'devise/registrations/edit' %> in my modal tag and it is being called when the launch modal button is clicked but rails is through me a undefined variable method in regards to devises use of resource. I know resource is just a user object but the home conroller does not know how to resolve this, i thought the render template method resolves this letting rails use the devise registrations controller.
Any ideas? Im really eanting to keep the deafault devise controller to simplify future features? How does one call a view from a different controller in one controller allowing thuse of all the actions in the called controller being available.
Try adding this to application_helper.rb (from The Devise Wiki)
def resource_name
:user
end
def resource
@resource ||= User.new
end
def devise_mapping
@devise_mapping ||= Devise.mappings[:user]
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With