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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:47:42+00:00 2026-06-01T11:47:42+00:00

I have an application with Users, Machines, and Tests. Users have many Machines and

  • 0

I have an application with Users, Machines, and Tests.
Users have many Machines and Tests
Machines belong to Users
Tests belong to Machines

*While on the Test Show page, I want to add a link to go to that Test’s parent Machine Show page. *

My TestsController reads:

  def show
@test = Test.find(params[:id])
...
end

My Test show page has the following link:

<%= link_to 'Back to Machine', machine_path(@machine) %>

For some reason the link is sending the user to

 /machines/test_id

instead of

/machines/machine_id  

I think I need something in the TestsController Show section like:

def show
@test = Test.find(params[:id])
@machine = Machine.find(params[:id])
...
end

but it must not be correct because I’m getting errors.

  • 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-01T11:47:43+00:00Added an answer on June 1, 2026 at 11:47 am

    Try something like this

    def show
      @test = Test.find(params[:id])
      @machine = @test.machine
      ...
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that allow users to choose picture from native gallery then
We have a VB6 application that uses the vbprndlg.dll library to show print selection
Let's say I have 3 logged on users. I have a test application which
I have a server application that handles clients requests in different manner. I want
I have a test application that allows the user to select a culture from
I have an application with Users, Posts and Comments. Users has_many Posts, Posts has_many
I have an application where users can store items. Now each type of account
I have an application where users select their own display columns. Each display column
In my web application users have the ability to upload games which are then
I have an application where multiple users can login(not simultaneously though!only a single user

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.