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 9162837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:18:29+00:00 2026-06-17T14:18:29+00:00

In a partial file of my application I have the following code snippet for

  • 0

In a partial file of my application I have the following code snippet for displaying user navigation(through Devise):-

<ul class="nav pull-right">
  <% if user_signed_in? %>
      <li>
        <%= current_user.email do %>
        <i class=" icon-user icon-black"></i>
        <% end %>
      </li>
     <li>
       <%= link_to "Your Links", profiles_index_path do %>
       <i class=" icon-user icon-black"></i>
       <% end %>
     </li> 
     <li>
       <%= link_to "Sign out", destroy_user_session_path, :method => 'delete' do %>
       <i class=" icon-user icon-black"></i> 
       <% end %>
    </li>

   <% else %>
     <li>
      <%= link_to "Login", new_user_session_path do %> 
      <i class=" icon-lock"></i>  
      <% end %>
    </li>
    <li>
      <%= link_to "Sign up", new_user_registration_path do %>
      <i class=" icon-home"></i>
      <% end %>
    </li>
  <% end %>
</ul>

But I’m getting an error saying:-

undefined method `stringify_keys' for "/users/sign_in":String

Now my questions are:-

  1. What is `stringify_keys’ in general??
  2. How do I resolve this in my code???

Thanks…

  • 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-06-17T14:18:30+00:00Added an answer on June 17, 2026 at 2:18 pm

    1) stringify_keys is a method that is called on a hash to convert its keys from symbols to strings. It’s added by Rails – it’s not a standard Ruby method. Here it is in the docs.

    {:a => 1, :b => 2}.stringify_keys # => {"a" => 1, "b" => 2}
    

    2) This means that your code is passing "/users/sign_in" somewhere that is expecting a hash. Closer inspection reveals that you are mixing and matching two forms of link_to:

    # specify link contents as an argument
    link_to "The text in the link", "/path/to/link", some: "options"
    
    # specify link contents in a block
    link_to "/path/to/link", some: "options" do
      "The text in the link"
    end
    

    As you can see you are trying to do both:

    <%= link_to "Sign out", destroy_user_session_path, :method => 'delete' do %>
      <i class=" icon-user icon-black"></i> 
    <% end %>
    

    and Rails expects the second argument in the block form to be the options hash, so it is calling stringify_keys on it which is causing your error.

    Change those links to look like this instead:

    <%= link_to destroy_user_session_path, :method => 'delete' do %>
      <i class=" icon-user icon-black"></i> Sign out 
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code... public partial class DownloadFile : System.Web.UI.Page { protected void
I have an entity called File, I created a partial class with a property
I have the following inide my Page_Load on an aspx.cs file: public abstract partial
I have a settings file in my Winforms application called Settings.settings with a partial
I have a (partial) qmake project file like this: TEMPLATE=lib TARGET=whatever SOURCES=whatever.cpp HEADERS=whatever.h This
I have made a resource. resources :dashboards I have a partial file which contains
I have the following form. The first button opens a text file and displays
I have the following log4j2.xml file: <?xml version=1.0 encoding=UTF-8?> <configuration status=OFF> <appenders> <RollingFile name=testLog
In my application I have 3 major parts: Exe : an executable file Lib_A
In my WPF C# application, I have included an executable file (.EXE) into the

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.