Module: ActiveAdmin::Resource::Routes

Included in:
Page, ActiveAdmin::Resource
Defined in:
lib/active_admin/resource/routes.rb

Defined Under Namespace

Classes: RouteBuilder

Instance Method Summary collapse

Instance Method Details

#route_batch_action_path(params = {}, additional_params = {}) ⇒ Object


11
12
13
# File 'lib/active_admin/resource/routes.rb', line 11

def route_batch_action_path(params = {}, additional_params = {})
  route_builder.batch_action_path(params, additional_params)
end

#route_builderObject


35
36
37
# File 'lib/active_admin/resource/routes.rb', line 35

def route_builder
  @route_builder ||= RouteBuilder.new(self)
end

#route_collection_path(params = {}, additional_params = {}) ⇒ String

Returns the path to this resource collection page.

Examples:

“/admin/posts”

Parameters:

  • params (Hash) (defaults to: {})

    of params: { study_id: 3 }

Returns:

  • (String)

    the path to this resource collection page


7
8
9
# File 'lib/active_admin/resource/routes.rb', line 7

def route_collection_path(params = {}, additional_params = {})
  route_builder.collection_path(params, additional_params)
end

#route_edit_instance_path(resource, additional_params = {}) ⇒ Object


22
23
24
# File 'lib/active_admin/resource/routes.rb', line 22

def route_edit_instance_path(resource, additional_params = {})
  route_builder.member_action_path(:edit, resource, additional_params)
end

#route_instance_path(resource, additional_params = {}) ⇒ String

Returns the path to this resource collection page.

Examples:

“/admin/posts/1”

Parameters:

  • resource (ActiveRecord::Base)

    the instance we want the path of

Returns:

  • (String)

    the path to this resource collection page


18
19
20
# File 'lib/active_admin/resource/routes.rb', line 18

def route_instance_path(resource, additional_params = {})
  route_builder.instance_path(resource, additional_params)
end

#route_member_action_path(action, resource, additional_params = {}) ⇒ Object


26
27
28
# File 'lib/active_admin/resource/routes.rb', line 26

def route_member_action_path(action, resource, additional_params = {})
  route_builder.member_action_path(action, resource, additional_params)
end

#route_prefixObject

Returns the routes prefix for this config


31
32
33
# File 'lib/active_admin/resource/routes.rb', line 31

def route_prefix
  namespace.route_prefix
end

#route_uncountable?Boolean

Returns:

  • (Boolean)

39
40
41
42
43
# File 'lib/active_admin/resource/routes.rb', line 39

def route_uncountable?
  config = resources_configuration[:self]

  config[:route_collection_name] == config[:route_instance_name]
end