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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:43:39+00:00 2026-06-16T06:43:39+00:00

I really have no clue why it happen. this is my routes resources :users

  • 0

I really have no clue why it happen.

this is my routes

resources :users do
    resources :bookmarks
end

Controller

# bookmarks_controller
def edit 
    # this returns perfectly data in the edit view
    @bookmark = current_user.bookmarks.find(params[:id])
end

This is the view

<%= form_for @bookmark do |b| %>
<% end %>

Since everything messed up when I nested the bookmarks resources inside users it causes the error

undefined method `bookmark_path’

Then I change the form to

<%= form_for user_bookmark_path(current_user, @bookmark) do |b| %>

The error is gone but there is no such data in the text field form, and the form action is /users/[user_id]/bookmarks/[bookmark_id]/edit

rake routes info

user_bookmarks     GET    /users/:user_id/bookmarks(.:format)          bookmarks#index
                   POST   /users/:user_id/bookmarks(.:format)          bookmarks#create
new_user_bookmark  GET    /users/:user_id/bookmarks/new(.:format)      bookmarks#new
edit_user_bookmark GET    /users/:user_id/bookmarks/:id/edit(.:format) bookmarks#edit
user_bookmark      GET    /users/:user_id/bookmarks/:id(.:format)      bookmarks#show
                   PUT    /users/:user_id/bookmarks/:id(.:format)      bookmarks#update
                   DELETE /users/:user_id/bookmarks/:id(.:format)      bookmarks#destroy

Any idea how to fix it ? 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-16T06:43:40+00:00Added an answer on June 16, 2026 at 6:43 am

    Try something like:

    <%= form_for [current_user, @bookmark] do |b| %>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Really have no clue, how to proceed. I have a controller called Application which
Is this code OK? I don't really have a clue which normalization-form I should
I really have problem with this one. So I have a jar with a
I really have no idea what I did to cause this exception, but I
I really have no idea why I'm struggling with this so much. I'm scraping
I really have no idea how to go about this. So far all I
It doesn't really have to add newlines, just something readable. Anything better than this?
Cant get this script to work with my menu really have tried everything any
i've been trying to figure this out and i have absolutely no clue why
Sorry for the none-descriptive title, but I didn't really have a clue as to

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.