Module: NitroRails::NitroOptionsHelper
- Included in:
- NitroRails::NitroFormHelper::NitroFormBuilder
- Defined in:
- app/helpers/nitro_rails/nitro_options_helper.rb
Defined Under Namespace
Classes: NitroOptions
Instance Method Summary collapse
-
#nitro_defaults(nitro_options) ⇒ Object
This shouldn’t need to be run every time nitro_options is called.
- #nitro_options(*options) {|nitro_options| ... } ⇒ Object
Instance Method Details
#nitro_defaults(nitro_options) ⇒ Object
This shouldn’t need to be run every time nitro_options is called
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/nitro_rails/nitro_options_helper.rb', line 13 def nitro_defaults() .translate(:audio) do |value| .concat(:data, :controller, "audio") .concat(:data, :action, "audio#play") .concat(:data, :audio, value) end # Need to deal with adding styles when style key already exists if(.[:style].class == Hash) .override(:style, .delete(:style).map do |key, value| "#{key.to_s.dasherize}: #{ value.is_a?(Integer) ? "#{value}px" : value };" end.join(" ")) end end |
#nitro_options(*options) {|nitro_options| ... } ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/helpers/nitro_rails/nitro_options_helper.rb', line 4 def (*, &block) = NitroOptions.new(*) nitro_defaults() # app_defaults(nitro_options) yield return . end |