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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:43:35+00:00 2026-05-20T10:43:35+00:00

Sorry if this has been asked elsewhere, but I can’t figure this out. I

  • 0

Sorry if this has been asked elsewhere, but I can’t figure this out. I have a forum with sections, topics, and replies. I’m trying to edit and delete replies from the show topic view. This is the structure:

resources :sections do
  resources :topics do
    resources :replies
  end
end

So I do a rake routes to see where I’m linking my edit reply. I see that its edit_section_topic_reply and in my link_to I add _path to it. Now this is what I can’t figure out. What parameters am I passing it? Shouldn’t it be:

<%= link_to 'Edit', edit_section_topic_reply_path(@reply, @topic, @section) %>

I get a ActionController::RoutingError in Topics#show when I do this.

No route matches {:topic_id=>#<Topic id: 2, section_id: 2, user_id: nil, subject: "subject", body: "body", created_at: "2011-03-04 08:37:37", updated_at: "2011-03-04 21:37:16">, :controller=>"replies", :action=>"edit", :section_id=>nil, :id=>#<Section id: 2, name: "Section", description: "Section Description", created_at: "2011-03-04 07:50:56", updated_at: "2011-03-04 07:50:56">}

It seems like it isn’t passing IDs, but the nest before, my new topic works fine

new_section_topic_reply_path(@topic, @section)
  • 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-20T10:43:36+00:00Added an answer on May 20, 2026 at 10:43 am

    I really dislike this aspect of the link_to helper. In the interest of making your code more readable and less prone to error, I would suggest that you be explicit about which IDs you are passing in.

    <%= link_to 'Edit', edit_section_topic_reply_path(:id => @reply.id, 
                                                      :topic_id => @topic.id, 
                                                      :section_id => @section.id) %>
    

    I’ve run into too many subtle and seemingly insane bugs due to params being out of order in a link_to.

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

Sidebar

Related Questions

Sorry if this has been asked elsewhere. I have looked but can't find any
I'm sorry if this question has been asked. I have looked but can not
Sorry if this has been asked but can't find anything. I have a table
Sorry if this has been asked elsewhere, I've been looking and can't find it
Sorry if this has been asked before but I've tried searching and can't find
I'm sorry if this question has been asked before, but I can't seem to
Sorry if this has been asked, but how can I improve the following with
Sorry if this has been asked before, but I can't find a clear enough
I am sorry if this has been asked already, but I have been looking
Sorry if this has been asked somewhere else, but I have looked all around,

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.