Class: ActionView::Helpers::JavaScriptElementProxy
- Inherits:
-
JavaScriptProxy
- Object
- JavaScriptProxy
- ActionView::Helpers::JavaScriptElementProxy
- Defined in:
- lib/jquery/jrails.rb
Overview
:nodoc:
Constant Summary collapse
- JQUERY_VAR =
PrototypeHelper::JQUERY_VAR
Instance Method Summary collapse
-
#initialize(generator, id) ⇒ JavaScriptElementProxy
constructor
A new instance of JavaScriptElementProxy.
- #reload(options_for_replace = {}) ⇒ Object
- #replace(*options_for_render) ⇒ Object
- #replace_html(*options_for_render) ⇒ Object
- #value ⇒ Object
- #value=(value) ⇒ Object
Constructor Details
#initialize(generator, id) ⇒ JavaScriptElementProxy
Returns a new instance of JavaScriptElementProxy.
245 246 247 248 249 |
# File 'lib/jquery/jrails.rb', line 245 def initialize(generator, id) id = id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id @id = id super(generator, "#{JQUERY_VAR}(\"#{id}\")") end |
Instance Method Details
#reload(options_for_replace = {}) ⇒ Object
259 260 261 |
# File 'lib/jquery/jrails.rb', line 259 def reload(={}) replace(.merge({ :partial => @id.to_s.sub(/^#/,'') })) end |
#replace(*options_for_render) ⇒ Object
255 256 257 |
# File 'lib/jquery/jrails.rb', line 255 def replace(*) call 'replaceWith', @generator.send(:render, *) end |
#replace_html(*options_for_render) ⇒ Object
251 252 253 |
# File 'lib/jquery/jrails.rb', line 251 def replace_html(*) call 'html', @generator.send(:render, *) end |
#value ⇒ Object
263 264 265 |
# File 'lib/jquery/jrails.rb', line 263 def value() call 'val()' end |
#value=(value) ⇒ Object
267 268 269 |
# File 'lib/jquery/jrails.rb', line 267 def value=(value) call 'val', value end |