Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Can you namespace the default dossier route? #50

@cullepm3

Description

@cullepm3

We have an admin console that uses routes starting with 'admin'. All of the admin routes use controllers that inherit from Admin::ApplicationController. This controller has auth logic (ie. ensure_super_user).

Is it possible to configure dossier default route / controller to use a different namespace? In other words, is it possible to configure dossier's automatically created 'report' route so that it is 'admin/report' and those routes use a ReportController derived from Admin::ApplicationController instead?

I tried rolling my own, which more or less works eg:

#routes.rb 
namespace :admin do
  ...
  match 'reports/:action', :controller=>'reports', :as => :reports

class Admin::ReportsController < Admin::ApplicationController

But occasionally things don't work as expected. For instance, the options don't get passed automatically to the report. I fixed by passing params[:options] when I create the report, but it feels like I'm duplicating internal behavior. Is there a better way?

#AdminReport::Controller#referrals_report
    report = ReferralsReport.new(params[:options])
    render template: 'admin/reports/referrals', locals: {report: report.run}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions