Class: Reativo::Cell::Theme
- Inherits:
-
Trailblazer::Cell
- Object
- Trailblazer::Cell
- Reativo::Cell::Theme
- Includes:
- ActionView::Helpers::CspHelper, ActionView::Helpers::CsrfHelper, React::Rails::ViewHelper, Webpacker::Helper
- Defined in:
- app/models/reativo/cell/theme.rb
Instance Method Summary collapse
- #content_security_policy? ⇒ Boolean
- #current_user ⇒ Object
- #flash_messages(opts = {}) ⇒ Object
- #form_authenticity_token ⇒ Object
- #protect_against_forgery? ⇒ Boolean
Instance Method Details
#content_security_policy? ⇒ Boolean
12 13 14 |
# File 'app/models/reativo/cell/theme.rb', line 12 def content_security_policy? context[:controller].send(:content_security_policy?) end |
#current_user ⇒ Object
30 31 32 |
# File 'app/models/reativo/cell/theme.rb', line 30 def current_user context[:controller].current_user end |
#flash_messages(opts = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/models/reativo/cell/theme.rb', line 20 def (opts = {}) = [] controller.flash.each do |type, | type = 'success' if type == 'notice' type = 'error' if type == 'alert' << {title: , type: type} if end end |
#form_authenticity_token ⇒ Object
16 17 18 |
# File 'app/models/reativo/cell/theme.rb', line 16 def form_authenticity_token context[:controller].send(:form_authenticity_token) end |
#protect_against_forgery? ⇒ Boolean
8 9 10 |
# File 'app/models/reativo/cell/theme.rb', line 8 def protect_against_forgery? context[:controller].send(:protect_against_forgery?) end |