Module: Isaca::Rails::ApplicationHelper
- Defined in:
- app/helpers/isaca/rails/application_helper.rb
Instance Method Summary collapse
-
#isaca_consent_javascript ⇒ Object
Injects the isaca privacy policy and cookie consent notices.
-
#isaca_flash_messages ⇒ Object
Presents beautiful flash notices if flash notices exist.
-
#isaca_form_errors(model) ⇒ Object
Presents beautiful error messages for form objects.
-
#link_to_create_isaca_account(**options) ⇒ Object
Provides a link to create an ISACA account.
-
#link_to_forgot_isaca_credentials ⇒ Object
Provides a link to reset user credentials.
Instance Method Details
#isaca_consent_javascript ⇒ Object
Injects the isaca privacy policy and cookie consent notices
3 4 5 |
# File 'app/helpers/isaca/rails/application_helper.rb', line 3 def javascript_include_tag 'https://www.isaca.org/info/shared/js/isaca-consent.min.js' end |
#isaca_flash_messages ⇒ Object
Presents beautiful flash notices if flash notices exist
8 9 10 11 12 13 14 |
# File 'app/helpers/isaca/rails/application_helper.rb', line 8 def content_tag :div do flash.collect do |name, | concat(content_tag :div, , class: "ir-flash ir-flash-#{name.underscore}") end end end |
#isaca_form_errors(model) ⇒ Object
Presents beautiful error messages for form objects
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/helpers/isaca/rails/application_helper.rb', line 17 def isaca_form_errors(model) if model.errors.size > 1 = 'The following errors occurred:' else = 'The following error occurred:' end concat(content_tag(:p, )) content_tag :div, class: 'ir-flash ir-flash-alert' do error_list = content_tag (:ul) do model.errors..collect do || concat(content_tag :li, ) end end concat(error_list) end end |
#link_to_create_isaca_account(**options) ⇒ Object
Provides a link to create an ISACA account
44 45 46 47 48 |
# File 'app/helpers/isaca/rails/application_helper.rb', line 44 def link_to_create_isaca_account(**) url = 'https://www.isaca.org/ecommerce/Pages/CreateAccountLite.aspx?pf=1' url.concat("&ReturnURL=#{Isaca::Rails.configuration.redirect_after_account_creation}") if Isaca::Rails.configuration.redirect_after_account_creation link_to 'Create ISACA Account', url, target: :blank, class: ( && .has_key?(:class) ? [:class] : '') end |
#link_to_forgot_isaca_credentials ⇒ Object
Provides a link to reset user credentials
38 39 40 41 |
# File 'app/helpers/isaca/rails/application_helper.rb', line 38 def link_to_forgot_isaca_credentials link_to 'Forgot password and/or username?', 'https://www.isaca.org/ecommerce/Pages/Forgot-Password.aspx', target: :blank end |