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

  • Home
  • SEARCH
  • 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 6931107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:32:03+00:00 2026-05-27T11:32:03+00:00

I have a double namespace situation, where my controllers look like this: CandidateController Candidate::PerformanceController

  • 0

I have a double namespace situation, where my controllers look like this:

CandidateController
Candidate::PerformanceController
Candidate::Performance::ReviewController

In Rails 2, I was able to use redirect_to from the Candidate::Performance::ReviewController controller in order to redirect to an action in the CandidateController, like so:

class Candidate::Performance::ReviewController < ApplicationController

  before_filter :ensure_manager

  # ...

  def ensure_manager
    if !current_user.manager?
      flash[:warning] = t(:must_be_manager)
      redirect_to :controller => '/candidate', :action => :index
    end
  end
end

The / in controller => '/candidate' would allow Rails to redirect from app.com/performance/reviews to app.com/candidate.

However, this seems to not work the same in Rails 3.1. Instead, my redirect_to goes to app.com/candidate//candidate. What is the correct way to specify a “absolute” controller within a redirect_to hash (ie. without using a path helper)?

Update: I know this would be infinitely easier if I just use named route helpers (ie. candidate_path). Unfortunately, there is a lot of legacy code in our codebase which doesn’t use RESTful routing and instead uses the default “catch-all” route; ie. we have a lot of actions with no named route to fallback on.

  • 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-27T11:32:04+00:00Added an answer on May 27, 2026 at 11:32 am

    If anyone else runs into this problem, it seems to be a known issue (unsure whether they consider it a bug or not, given the lack of response on the issue page from anyone working on Rails).

    Until they patch it (assuming they do), I’ve added the following little monkey patch into an initializer, based on the code given in the original post of that issue:

    module ActionDispatch
      module Routing
        class RouteSet
          class Generator
            def use_relative_controller_with_absolute_paths!
              return if controller.starts_with?('/')
              use_relative_controller_without_absolute_paths!
            end
    
            alias_method_chain :use_relative_controller!, :absolute_paths
          end
        end
      end
    end
    

    Hope this can help someone else!

    Update: It seems that this was fixed in Rails here.

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

Sidebar

Related Questions

I have something like this: #include <iostream> namespace N { typedef std::pair<int, double> MyPair;
If I have a double (234.004223), etc., I would like to round this to
I have this in a header: double commonFunction( ... ) { /*...*/ } namespace
I have this: using namespace boost::numeric::ublas; matrix<double> m (3, 2); int k = 0;
Right now I have double numba = 5212.6312 String.Format({0:C}, Convert.ToInt32(numba) ) This will give
I have a double value f and would like a way to nudge it
I have a double thats got a value of something like 0.50000 but I
Although you wouldn't want to do this, if you have a namespace COMPANY, and
I have a very simple function in C++: double testSpeed() { using namespace boost;
I have the following two boost::fusion maps. namespace bf = boost::fusion; typedef bf::map<bf::pair<char,float>,bf::pair<int,double>> FusionMap;

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.