Module: QueryDiet::Widget::Helper
- Defined in:
- lib/query_diet/widget.rb
Instance Method Summary collapse
Instance Method Details
#query_diet_widget(options = {}) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/query_diet/widget.rb', line 55 def ( = {}) = {:nonce => false} = .reverse_merge() nonce_attribute = .fetch(:nonce) ? " nonce=\"#{content_security_policy_nonce}\"" : '' html = Widget.css(nonce_attribute) + Widget.html() + Widget.js(nonce_attribute) html.respond_to?(:html_safe) ? html.html_safe : html end |