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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:06:10+00:00 2026-05-30T15:06:10+00:00

I have very interesting scenario: I’ve specified two controllers, one for global events and

  • 0

I have very interesting scenario:

I’ve specified two controllers, one for global events and another another once for company specific events. In routes, it is specified like this:

resources :companies do
  resources :events
end
resources: events

Running rake routes I can see the routes being generated:

events GET  /events(.:format) events#index
company_events GET /companies/:company_id/events(.:format) events#index 

Both paths seem to route to the same controller (the global one)…
I have the second controller under controller/companies that goes something like this:

class Companies::EventsController < ApplicationController
 # stuff
end

It never routes in that controller above, no matter whether I use company_evens_path(@company). always goes to the other one.
It used to work in rails 2.3 for me, I’m currently using 3.2

  • 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-30T15:06:11+00:00Added an answer on May 30, 2026 at 3:06 pm

    Ok as stated above, I would recommend doing something like this:

    def index
      if params[:company_id]
        @events = Company.find(params[:company_id]).events
      else
        @events = Events.all
      end
    end
    

    although if you need to you can specify a controller:

    resources :companies do
      resources :events, :controller => "companies/events"
    end
    resources: events
    

    and just create a companies folder inside your controllers folder to put your Companies::EventsController inside

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

Sidebar

Related Questions

Here is one very interesting problem. I am using SQL Server 2008. I have
I have a very interesting issue with only specific IE implementations. I have an
I have one very interesting question (for me :) ).. I'm using jquery and
I inspired by MeBigFatGuy interesting question , in this conection I have very specific
This is a very interesting thing. I have an APK file, com.company.app.apk. When installed
I have a very interesting problem on my LinqToSql model. On some of my
I've seen jint in Codeplex. It looks very interesting. Have you used it? Is
We have very strange problem, one of our applications is continually querying server by
I have very simple window where I have 2 buttons - one for cancel,
I have run into a very interesting problem trying to debug my custom PHP

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.