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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:15:37+00:00 2026-06-07T12:15:37+00:00

<%= link_to t(‘.new’, :default => t(helpers.links.new)), new_equipment_path, :class => ‘btn btn-primary’ %> I have

  • 0
<%= link_to t('.new', :default => t("helpers.links.new")), new_equipment_path, :class => 'btn btn-primary' %>

I have the above code in a view, but am getting the following error when clicking the link: No route matches {:action=>"show", :controller=>"equipment"}

My routes file contains:

resources :equipment

resources :workouts

match ':controller(/:action(/:id))(.:format)'

Why is it trying to access the show action?

Here are the entries from my routes:

   equipment_index GET        /equipment(.:format)                   equipment#index
                   POST       /equipment(.:format)                   equipment#create
     new_equipment GET        /equipment/new(.:format)               equipment#new
    edit_equipment GET        /equipment/:id/edit(.:format)          equipment#edit
         equipment GET        /equipment/:id(.:format)               equipment#show
                   PUT        /equipment/:id(.:format)               equipment#update
                   DELETE     /equipment/:id(.:format)               equipment#destroy
  • 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-07T12:15:40+00:00Added an answer on June 7, 2026 at 12:15 pm

    This issue has cropped up before and is related to how rails scaffolding generates the new.html.erb file for models that have names like ‘equipment’ which are both singular and plural.

    If you inspect the form_for in the new.html.erb file you’ll see equipment_path in the link_to at the bottom. For these models with singular==plural names that refers to a route that is actually for the show action, hence your error message.

    The advice is often along the lines of ‘avoid model names like this if you can’ or it involves a bit of messing around with the config/initializers/inflections.rb file to force a plural version of the model name. Of course then you end up with an app with very odd sounding references to models: ‘equipments’ isn’t very nice to work with (and someone later on will ‘fix’ it, messing things up again).

    To keep the model name grammatically correct, you need to fix the form_for i.e.:

    <% form_for(@equipment, :url=> {:action=>'create'}) do |f| %>

    and the link_to:

    <%= link_to 'Back', equipment_index_path %>

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

Sidebar

Related Questions

Link to code Hello all, I have a circle menu (above link) where I
I want to use link_to to create a new article and set the article's
I have a link_to that toggles a boolean field when clicked. The problem is
I have a link to open Fancybox box as follows: <a class=fancybox rel=gallery href=<?php
here is a link to what im basing my code off of....but i want
link_to_remote has an :href option to unobtrusively add regular links just in case javascript
My link_to tag is: <%= link_to(My test title,{:controller=>search, :action=>for-sale, :id=> listing.id, :title => listing.title,
How to open a new window with link to OutSide of MVC and take
I want to create link_to google like in Rails. Let me explain. On simple
I have the generated link to the ISSUU's PDF: http://issuu.com/press/docs/2008-12?mode=window&printButtonEnabled=false&shareButtonEnabled=false&searchButtonEnabled=false&backgroundColor=%23222222 then, I want 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.