Class: FlexiAdmin::Components::Resource::ShowPageComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- FlexiAdmin::Components::Resource::ShowPageComponent
- Includes:
- Helpers::ActionHelper, Helpers::ResourceHelper
- Defined in:
- lib/flexi_admin/components/resource/show_page_component.rb
Instance Attribute Summary collapse
-
#context_params ⇒ Object
readonly
Returns the value of attribute context_params.
-
#disabled ⇒ Object
readonly
Returns the value of attribute disabled.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #context ⇒ Object
-
#initialize(resource, context_params:, scope: nil, disabled: true) ⇒ ShowPageComponent
constructor
A new instance of ShowPageComponent.
Methods included from Helpers::ActionHelper
Methods included from Helpers::ResourceHelper
#autocomplete_path, #bulk_action_path, #datalist_path, #edit_resource_path, #paginate, #resource__path, #resource_input_name, #resource_path, #resources_path, #scope, #scope_plural, #scope_singular
Constructor Details
#initialize(resource, context_params:, scope: nil, disabled: true) ⇒ ShowPageComponent
Returns a new instance of ShowPageComponent.
10 11 12 13 14 15 |
# File 'lib/flexi_admin/components/resource/show_page_component.rb', line 10 def initialize(resource, context_params:, scope: nil, disabled: true) @resource = resource @scope = scope @context_params = context_params @disabled = disabled end |
Instance Attribute Details
#context_params ⇒ Object (readonly)
Returns the value of attribute context_params.
8 9 10 |
# File 'lib/flexi_admin/components/resource/show_page_component.rb', line 8 def context_params @context_params end |
#disabled ⇒ Object (readonly)
Returns the value of attribute disabled.
8 9 10 |
# File 'lib/flexi_admin/components/resource/show_page_component.rb', line 8 def disabled @disabled end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
8 9 10 |
# File 'lib/flexi_admin/components/resource/show_page_component.rb', line 8 def resource @resource end |
Instance Method Details
#context ⇒ Object
17 18 19 |
# File 'lib/flexi_admin/components/resource/show_page_component.rb', line 17 def context @context ||= FlexiAdmin::Models::Resources::Context.from_params(context_params.merge(scope: @scope), resource) end |