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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:50:37+00:00 2026-05-31T06:50:37+00:00

Alright, I was very happy iterating over items table when suddenly BANG! NoMethodError in

  • 0

Alright, I was very happy iterating over items table when suddenly BANG!

NoMethodError in Items#index

undefined method `stringify_keys' for "/items/7":String

Why like this?

Item Controller

def index 
  @item = current_user.bar.items.all
end

Item Index View

<% current_user.bar.items.each do |item|%>
    <tr>
        <td><%= link_to(image_tag( item.foto.url.to_s), item.name, item_path(item.id)) %></td>
    </tr >
<% end %>
  • 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-31T06:50:38+00:00Added an answer on May 31, 2026 at 6:50 am

    Check out the method signature for link_to.

    You’re handing it an image, some text, and a path. That’s wrong. The reason you’re getting that error is because link_to thinks that the last argument is an options hash, when really, it’s a string (the path). You need to remove the image_tag, the item.name, or simply provide a block to include them both:

    <%= link_to item_path(item) do %>
      <%= image_tag(item.foto.url) %> <%= item.name %>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright. So I have a very large amount of binary data (let's say, 10GB)
Alright, I am very confused, so I hope you friends can help me out.
Alright, this is a very simple question. I just installed Tomcat 6 on my
Alright, here goes. I'm making a very basic app, and I want the user
I am learning cakePHP, everything seems alright except that I am very confused of
Alright, another interesting problem over at Route 50. We wanted to implement a true
Alright, I'm brand new to vim, and I'm seeming to have a very annoying
Alright, I've just finished normalizing a table. What I didn't really consider when I
Alright, so this is getting very very annoying. I have an unmanaged VC 2010
Alright well I'm still a very new coder in Greasemonkey and just know a

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.