Class: Components::ReportButton
- Inherits:
-
Base
- Object
- Base
- Components::ReportButton
- Defined in:
- app/components/report_button.rb
Instance Method Summary collapse
-
#initialize(object:, path:) ⇒ ReportButton
constructor
A new instance of ReportButton.
- #render? ⇒ Boolean
- #view_template ⇒ Object
Constructor Details
#initialize(object:, path:) ⇒ ReportButton
Returns a new instance of ReportButton.
4 5 6 7 |
# File 'app/components/report_button.rb', line 4 def initialize(object:, path:) @object = object @path = path end |
Instance Method Details
#render? ⇒ Boolean
19 20 21 |
# File 'app/components/report_button.rb', line 19 def render? SiteSettings.multiuser_enabled? end |
#view_template ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/components/report_button.rb', line 9 def view_template GoButton( icon: "flag", href: @path, label: t("general.report", type: @object.model_name.human), variant: "outline-warning", nofollow: true ) end |