Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6181777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:05:05+00:00 2026-05-24T01:05:05+00:00

I’m trying to implement authentication with Devise in my Rails application (Rails 2.3.8, Devise

  • 0

I’m trying to implement authentication with Devise in my Rails application (Rails 2.3.8, Devise 1.0.7, mongrel running on Windows Vista). But I’m getting the following error:

undefined local variable or method `devise_mapping' for #<ActionView::Base:0x6d63890>

This is when I use the auto-generated partial _devise_links.html.

<%- if controller_name != 'sessions' %>
  <%= link_to t('devise.sessions.link'), new_session_path(resource_name) %><br />
<% end -%>

<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
  <%= link_to t('devise.registrations.link'), new_registration_path(resource_name) %><br />
<% end -%>

<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
  <%= link_to t('devise.passwords.link'), new_password_path(resource_name) %><br />
<% end -%>

<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
  <%= link_to t('devise.confirmations.link'), new_confirmation_path(resource_name) %><br />
<% end -%>

<%- if devise_mapping.lockable? && controller_name != 'unlocks' %>
  <%= link_to t('devise.unlocks.link'), new_unlock_path(resource_name) %><br />
<% end -%>

Any ideas on how to fix this? I’m assuming the devise_mapping variable is not getting included in my views, but what do I do about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:05:08+00:00Added an answer on May 24, 2026 at 1:05 am

    I realize this question is kind of old, but I think I figured out why you can’t just render that partial. The partial you’re trying to render is the partial for the links that show up below the sign_in/sign_up form.

    If you’d like to add those links to your application, this page on the Devise Wiki will show you how to do it, and it involves creating your own partial(s).

    EDIT (2019-04-01): Copying the information from the Devise wiki page here for persistence.

    How To: Add sign_in, sign_out, and sign_up links to your layout template

    First add sign_in/out links, so the appropriate one will show up depending on whether the user is _already_ signed in:

    # views/devise/menu/_login_items.html.erb
    <% if user_signed_in? %>
      <li>
      <%= link_to('Logout', destroy_user_session_path, method: :delete) %>        
      </li>
    <% else %>
      <li>
      <%= link_to('Login', new_user_session_path)  %>  
      </li>
    <% end %>
    

    The method: :delete part is required if you use the default HTTP method. To change it, you will need to tell Devise this:

    # config/initializers/devise.rb
      # The default HTTP method used to sign out a resource. Default is :delete.
      config.sign_out_via = :get
    

    You can then omit method: :delete on all your sign_out links.

    Next come the sign_up links. Again, these can be substituted with something else useful if the user is already signed in:

    # views/devise/menu/_registration_items.html.erb
    <% if user_signed_in? %>
      <li>
      <%= link_to('Edit registration', edit_user_registration_path) %>
      </li>
    <% else %>
      <li>
      <%= link_to('Register', new_user_registration_path)  %>
      </li>
    <% end %>
    

    Then use these templates in your layouts/application.html.erb, like this:

    # layouts/application.html.erb
    <ul class="hmenu">
      <%= render 'devise/menu/registration_items' %>
      <%= render 'devise/menu/login_items' %>
    </ul>
    <%= yield %>
    

    Add some menu styling to the CSS (here for a horizontal menu):

    ul.hmenu {
      list-style: none; 
      margin: 0 0 2em;
      padding: 0;
    }
    
    ul.hmenu li {
      display: inline;  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.