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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:09:51+00:00 2026-05-16T09:09:51+00:00

my routes should look like this: >rake routes GET /categories/:category_id/articles(.:format) {:controller=>articles, :action=>index} category_articles POST

  • 0

my routes should look like this:

    >rake routes

                      GET    /categories/:category_id/articles(.:format)          {:controller=>"articles", :action=>"index"}
    category_articles POST   /categories/:category_id/articles(.:format)          {:controller=>"articles", :action=>"create"}
 new_category_article GET    /categories/:category_id/articles/new(.:format)      {:controller=>"articles", :action=>"new"}
                      GET    /categories/:category_id/articles/:id(.:format)      {:controller=>"articles", :action=>"show"}
                      PUT    /categories/:category_id/articles/:id(.:format)      {:controller=>"articles", :action=>"update"}
     category_article DELETE /categories/:category_id/articles/:id(.:format)      {:controller=>"articles", :action=>"destroy"}
edit_category_article GET    /categories/:category_id/articles/:id/edit(.:format) {:controller=>"articles", :action=>"edit"}
                      GET    /categories(.:format)                                {:controller=>"categories", :action=>"index"}
           categories POST   /categories(.:format)                                {:controller=>"categories", :action=>"create"}
         new_category GET    /categories/new(.:format)                            {:controller=>"categories", :action=>"new"}
                      GET    /categories/:id(.:format)                            {:controller=>"categories", :action=>"show"}
                      PUT    /categories/:id(.:format)                            {:controller=>"categories", :action=>"update"}
             category DELETE /categories/:id(.:format)                            {:controller=>"categories", :action=>"destroy"}
        edit_category GET    /categories/:id/edit(.:format)                       {:controller=>"categories", :action=>"edit"}

but whenever I try, for articles, to use anything other than
new_category_article_path,

<%= link_to 'Show', categories_article %>

I get this mean exception:

undefined local variable or method 'categories_article' for #<#<Class:0x00000102ce5768>:0x00000102ce3a80>

What is it I am doing wrong here?

  • 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-16T09:09:52+00:00Added an answer on May 16, 2026 at 9:09 am

    A couple things going on here:

    1. There’s no route defined that’s named “categories_article”. You might be looking for “category_articles” or “category_article”.
    2. For a “show” action, you need to specify the ID of an object to display. In this case, you also need to specify the parent id (category_id)
    3. When referring to these routes by name, you need to add “_path” or “_url” at the end.

    These three together makes something like:

    <%= link_to 'Show', category_articles_path(:category_id => category.id) %>
    

    or

    <%= link_to 'Show', category_article_path(:category_id => category.id, :id => article.id) %>
    

    or, shorter:

    <%= link_to 'Show', [category, article] %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to implement hash value i.e the Url should look like this: /home/index/#create
My folder look like this: (root)/Areas/Admin/Views/.. (root)/Areas/Admin/Controllers/... (root)/Areas/Admin/Routes.cs (root)/Areas/Forum/Views/.. (root)/Areas/Forum/Controllers/... (root)/Areas/Forum/Routes.cs public class Routes
I'm trying to construct a Link. The resulting Link should look something like this:
I have urls that look like this ~\articles\energy\topweek ~\articles\metals\latestpopular where second url string is
I have this sole route in my app: routes.MapRoute( Default, {controller}/{action}/{id}, new { controller
My routes.php has the following line of code: Router::connect('/', array('controller' => 'users', 'action' =>
In my routes.rb I've got: map.connect ':name', :controller => 'my_classes', :action => 'show' And
I have a route: routes.MapRoute( Company, {id}/{name}.aspx, new { controller = Company, action =
My route looks like: routes.Add(new Route({companyName}/{action}/{id}, new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new {
According to rake routes, there's the same path for getting an index of objects

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.