Class: ActionView::Helpers::JavaScriptElementProxy

Inherits:
JavaScriptProxy
  • Object
show all
Defined in:
lib/jrails.rb

Overview

:nodoc:

Constant Summary

JQUERY_VAR =
PrototypeHelper::JQUERY_VAR

Instance Method Summary (collapse)

Constructor Details

- (JavaScriptElementProxy) initialize(generator, id)

A new instance of JavaScriptElementProxy



237
238
239
240
241
# File 'lib/jrails.rb', line 237

def initialize(generator, id)
  id = id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id
  @id = id
  super(generator, "#{JQUERY_VAR}(\"#{id}\")")
end

Instance Method Details

- (Object) reload(options_for_replace = {})



251
252
253
# File 'lib/jrails.rb', line 251

def reload(options_for_replace={})
  replace(options_for_replace.merge({ :partial => @id.to_s.sub(/^#/,'') }))
end

- (Object) replace(*options_for_render)



247
248
249
# File 'lib/jrails.rb', line 247

def replace(*options_for_render)
  call 'replaceWith', @generator.send(:render, *options_for_render)
end

- (Object) replace_html(*options_for_render)



243
244
245
# File 'lib/jrails.rb', line 243

def replace_html(*options_for_render)
  call 'html', @generator.send(:render, *options_for_render)
end

- (Object) value



255
256
257
# File 'lib/jrails.rb', line 255

def value()
  call 'val()'
end

- (Object) value=(value)



259
260
261
# File 'lib/jrails.rb', line 259

def value=(value)
  call 'val', value
end