0
votes

I am trying to confirm user accounts in test mode while using devise and rails. Here's the scenario. I changed the devise confirmation email that is sent into a partial that is rendered after a user has successfully signed up. Problem is it shows the following error "undefined method email". Here's my confirmation partial.

Welcome <%= @resource.email %>!

You can confirm your account through the link below:

<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>

. And below is my application_helper in order to access the resource details.
def resource_name
        :user
    end

def resource
    @resource ||= User.new
end

def devise_mapping
    @devise_mapping ||= Devise.mappings[:user]
end</pre> 
1

1 Answers

0
votes

Is @resource actually the user in application_helper? I know if it is nil it will be assigned a new User, but what is it before it assigns it?

I suspect @resource isn't a User, but something else (a something that doesn't have an email field).