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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:02:34+00:00 2026-06-18T05:02:34+00:00

I am getting a weird state in my apps routes. It’s a basic discussion

  • 0

I am getting a weird state in my apps routes.

It’s a basic discussion forum I am building with rails. I am using nested resources like:

 resources :forums do
  resources :discussions
 end

and generating a view to display all discussions with the requirement that clicking on any of these discussions should route to the appropriate discussion such as “forum/2/discussions/3”. Yet when I use:

<% Discussion.find_each do |discussion| %>
 <%= link_to discussion.title, forum_discussions_path(discussion.forum_id, discussion) %>
<% end %>

the generated url/link is “forums/2/discussion.3” Any ideas why there is a “.” instead of a “/”?

  • 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-18T05:02:35+00:00Added an answer on June 18, 2026 at 5:02 am

    You need to use the forum_discussion route, not the forum_discussions route

    forum_discussion GET /forums/:forum_id/discussions/:id(.:format) discussions#show
    

    Altogether that looks like

    <% Discussion.find_each do |discussion| %>
      <%= link_to discussion.title, forum_discussion_path(discussion.forum_id, discussion) %>
    <% end %>
    

    You were pointing it to this route

    forum_discussions GET /forums/:forum_id/discussions(.:format) discussions#index
    

    so the discussion.id value was being used as the :format option.

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

Sidebar

Related Questions

I'm getting a weird error, when initializing my deque or vector. I'm using QtCreator
i am getting weird python bus error when building a web app. http://pastie.org/714569 i
I am getting weird problem with my app. I have set-up one SharedPreference, like
I am getting a weird exception saying Msg 203, Level 16, State 2, Line
Im using merb, and getting weird variable in url after authentication. I figured out
I am using the JQuery slider UI Widget. I am getting weird problems when
I'm getting weird results from the System.out.print immediately below the Scanner declaration in the
I'm getting weird EXC_BAD_ACCESS errors. I thought that I didn't need to retain objects
I have a fulltext index on my table but am getting weird results... Think
Getting this weird LINQ error. title = System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String Here is the code I have:

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.