I'm in a confusing situation . I am using Devise for authentication in my application . And i want two different views for my Registration process . In my views i put them both in
class Users::RegistrationsController < Devise::RegistrationsController
resource = User.new
I believe we had the same problem when i wanted to put devise registration to other views and i gotten the same problem.
undefined resources or nil to fix this issue you need to
initialize the resource somehow. One way is to initialize resource in the
helpers/application_helpers: so you can call it to any views. note:
resource here is user
def resource_name :user end def resource @resource ||= User.new end def devise_mapping @devise_mapping ||= Devise.mappings[:user] end
I hope it helps you solve your problem.