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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:20:41+00:00 2026-05-12T07:20:41+00:00

I have added into my routes file prefix value to each map.resources line. So

  • 0

I have added into my routes file prefix value to each map.resources line. So it all looks like this:

map.resources :subjects, :path_prefix => ':company'

I have even added this line for default behavior

map.connect ':company/:controller/:action/:id'

which is not necessary (I believe) because all the routes are handled with resources method.

I fetch the :company param in my before_filter method in ApplicationController. Everything works. But.

Is it possible to change the behaviour of all *_path methods that it would set company value for all generated urls by default with the one taken from the url? To make it work perfectly I would have to add company value as param for each _path method. I believe it is possible to make it automatic.

  • 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-12T07:20:41+00:00Added an answer on May 12, 2026 at 7:20 am

    You should overwrite the default_url_options in your application controller.

    class ApplicationController > ActionController::Base
    
      # ...
    
      def default_url_options(options)
        { :company => current_company.id }
      end
    
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added navigation controller into my appication in didFinishLaunchingWithOptions like this LoginViewController *mainView
I have added XRRichTextbox into XtraReport, i just want to bind HTML into RichTextbox
I have added an imageView of size 300*300 into the interface in my ipad
I have installed the HerzultFourmBundle into my Symfony2 application, added the calls in the
I added the following route into my MVC app. routes.MapRoute(leads, leads/{leadId}, new { controller
I know this is a trivial question. But I have search all over google
I have routes defined for each module in my application, not heaps perhaps 10
I would like to have a form that gets output into a table. The
I have added a custom action to the CustomList type. For testing purposes I
I have added a parameter to my report with the option Allow Multiple Values

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.