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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:56:17+00:00 2026-05-31T01:56:17+00:00

I have a problem where on each users profile they have an edit button

  • 0

I have a problem where on each users profile they have an edit button for a section called wishlist, my problem is that when the user tries to click on the edit button it returns an error saying it cannot find wishlist with id e.g. 34 which is the user.id not the wishlist.id. But from what I can understand from the code that is not what I have wrote.

My code is as followed here:

users/show.html.erb

 <div class="post3">
    <h1><%= t('.mwg')%></h1><br />
    <div id = "table-2">
    <table width="240" >
<tbody>
        <% Wishlist.where(:user_id => @user).each do |wishlist| %>
        <tr><td width="30"><b>1:</b></td><td><%= wishlist.number_1 %></td></tr>
        <tr><td width="30"><b>2:</b></td><td><%= wishlist.number_2 %></td></tr>
        <tr><td width="30"><b>3:</b></td><td><%= wishlist.number_3 %></td></tr>
        <tr><td width="30"><b>4:</b></td><td><%= wishlist.number_4 %></td></tr>
        <tr><td width="30"><b>5:</b></td><td><%= wishlist.number_5 %></td></tr>
    </tbody> 
   </table>
  </div>
    <%if current_user %>
       <% if current_user.id == wishlist.user_id %>
         <div id="text3"><%= link_to t('.edit'), edit_wishlist_path(@wishlist) %></div><br />
       <%end%>
    <%end%>
<%end%>

No I tried changing the current_user.id == wishlist.user_id line to the following:

   <% if current_user.id == @wishlist.user_id %>

But I get the error of undefined method user_id

If I click on the edit for the original code it tries to find a wishlist who’s id matches that of the user but I want it to find a user whos id matches the user_id column.

  • 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-31T01:56:18+00:00Added an answer on May 31, 2026 at 1:56 am

    You need to call edit_wishlist_path(wishlist), not @wishlist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with a data-bound DataGrid control, in that despite each column
Original Problem: I have 3 boxes each containing 200 coins, given that there is
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Hi The problem am having is that I have multiple TreeView control and each
I keep having complaints that users are logged in as each other. They can
i have a problem is i got UItabbarController it contain 3 Tabbars each tabbar
I have a file in which each line contains two numbers. The problem is
Ok I have two modules, each containing a class, the problem is their classes
I have problem in some JavaScript that I am writing where the Switch statement
i have a mini app where users can login, view their profile, and follow

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.