Module: PluggableJs::Helpers::Controller

Defined in:
lib/pluggable_js/helpers.rb

Instance Method Summary collapse

Instance Method Details

#pluggable_js(hash) ⇒ Object Also known as: pjs

convert hash passed from controller’s action to data string



44
45
46
# File 'lib/pluggable_js/helpers.rb', line 44

def pluggable_js(hash)
  @data_string = hash.map { |key, value| "pjs_data.#{key} = #{value.to_json}" }.join('; ')
end