I've been trying to do this for a few hours now. I'm pretty new to Ruby and Rails.
In a devise.html.erb file I have
<div class="container">
<%= render :partial => 'layouts/header' if user_signed_in? %>
</div>
The above works fine. If the user has signed in, then they get to see the header at the top of my page, if they're not signed in, they don't see it.
But I need to have (because the user has to put in an address on the next page):
<div class="container">
<%= render :partial => 'layouts/header' if current_user.registration_complete? %>
And when I restart my app I get the error message:
NoMethodError in Devise/registrations#new
I have registration_complete defined elsewhere in my project, in user.rb (which other parts of my project have no trouble recognising) as:
#Determines whether user completed his profile on registration or not
def registration_complete?
self.address.present?
end
Is there somewhere else I should put this code, so it will be recognised in my devise.html.erb?