Class: ActionLink::Base
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- ActionLink::Base
- Defined in:
- app/components/action_link/base.rb
Overview
A component that every action link inherits from. It adds the API that all action links have in common.
Instance Method Summary collapse
-
#icon? ⇒ Boolean
Allows you to turn off the icon.
- #icon_tag(name) ⇒ Object
- #options ⇒ Object
- #permission? ⇒ Boolean
Methods inherited from ApplicationComponent
Constructor Details
This class inherits a constructor from ActionLink::ApplicationComponent
Instance Method Details
#icon? ⇒ Boolean
Allows you to turn off the icon.
31 32 33 |
# File 'app/components/action_link/base.rb', line 31 def icon? icon != false end |
#icon_tag(name) ⇒ Object
35 36 37 38 |
# File 'app/components/action_link/base.rb', line 35 def icon_tag(name) helpers.content_tag :i, nil, class: "o-acticon o-acticon--#{name}" end |
#options ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'app/components/action_link/base.rb', line 40 def { title: _title, class: _class, data: _data, target: _target, method: http_method } end |
#permission? ⇒ Boolean
26 27 28 |
# File 'app/components/action_link/base.rb', line 26 def _policy.public_send(:"#{_action}?") end |