Skip to content

No access to routes helpers from ActiveAdmin views [v4.0.0.beta5] #8279

Description

@amkisko

Route helpers are not available within ActiveAdmin views, even root_path is not available in the context of view Class.

ActionController::UrlGenerationError - No route matches {:action=>"index", :controller=>"active_admin/users"}:
  app/views/active_admin/_sidebar.html.erb:3
  app/views/layouts/active_admin.html.erb:15

It seems to be related to the recent change of separating contexts, so these helpers are still available under main_app variable.

Expected behavior

Route helpers are available.

Actual behavior

Helpers are not available, ActiveAdmin v4 code throws exception for new and generated resource.

How to reproduce

  • initialise ActiveAdmin v4 project
  • generate sample resource
  • run the app, try accessing the resource

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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