Method: Apotomo::JavascriptMethods#replace
- Defined in:
- lib/apotomo/widget/javascript_methods.rb
#replace(*args) ⇒ Object
Wraps the rendered content in a replace statement targeted at your Apotomo.js_framework setting.
Use :selector to change the selector.
Example:
Assuming you set Apotomo.js_framework = :jquery
and call replace in a state
replace :view => :squeak, :selector => "div#mouse"
#=> "$(\"div#mouse\").replaceWith(\"<div id=\\\"mum\\\">squeak!<\\/div>\")"
20 21 22 |
# File 'lib/apotomo/widget/javascript_methods.rb', line 20 def replace(*args) wrap_in_javascript_for(:replace, *args) end |