Module: LsaTdxFeedback::ViewHelpers
- Defined in:
- lib/lsa_tdx_feedback/view_helpers.rb
Instance Method Summary collapse
-
#lsa_tdx_feedback ⇒ Object
All-in-one helper that includes both modal and assets.
-
#lsa_tdx_feedback_assets ⇒ Object
Includes both CSS and JavaScript assets.
-
#lsa_tdx_feedback_css ⇒ Object
Includes the feedback gem CSS.
-
#lsa_tdx_feedback_js ⇒ Object
Includes the feedback gem JavaScript.
-
#lsa_tdx_feedback_modal ⇒ Object
Renders the feedback modal and trigger button.
-
#lsa_tdx_feedback_test ⇒ Object
Simple test method to verify helper is working.
Instance Method Details
#lsa_tdx_feedback ⇒ Object
All-in-one helper that includes both modal and assets
31 32 33 34 35 |
# File 'lib/lsa_tdx_feedback/view_helpers.rb', line 31 def lsa_tdx_feedback assets = lsa_tdx_feedback_assets modal = lsa_tdx_feedback_modal (assets + modal).html_safe end |
#lsa_tdx_feedback_assets ⇒ Object
Includes both CSS and JavaScript assets
24 25 26 27 28 |
# File 'lib/lsa_tdx_feedback/view_helpers.rb', line 24 def lsa_tdx_feedback_assets css = lsa_tdx_feedback_css js = lsa_tdx_feedback_js (css + js).html_safe end |
#lsa_tdx_feedback_css ⇒ Object
Includes the feedback gem CSS
14 15 16 |
# File 'lib/lsa_tdx_feedback/view_helpers.rb', line 14 def lsa_tdx_feedback_css stylesheet_link_tag 'lsa_tdx_feedback', 'data-turbo-track': 'reload', preload: false end |
#lsa_tdx_feedback_js ⇒ Object
Includes the feedback gem JavaScript
19 20 21 |
# File 'lib/lsa_tdx_feedback/view_helpers.rb', line 19 def lsa_tdx_feedback_js javascript_include_tag 'lsa_tdx_feedback', 'data-turbo-track': 'reload', defer: true end |
#lsa_tdx_feedback_modal ⇒ Object
Renders the feedback modal and trigger button
9 10 11 |
# File 'lib/lsa_tdx_feedback/view_helpers.rb', line 9 def lsa_tdx_feedback_modal render(partial: 'lsa_tdx_feedback/shared/feedback_modal') end |
#lsa_tdx_feedback_test ⇒ Object
Simple test method to verify helper is working
4 5 6 |
# File 'lib/lsa_tdx_feedback/view_helpers.rb', line 4 def lsa_tdx_feedback_test "HELPER IS WORKING!".html_safe end |