Class: ActionView::Helpers::JavaScriptElementProxy

Inherits:
JavaScriptProxy
  • Object
show all
Defined in:
lib/action_view/helpers/prototype_helper.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(generator, id) ⇒ JavaScriptElementProxy

Returns a new instance of JavaScriptElementProxy.



768
769
770
771
# File 'lib/action_view/helpers/prototype_helper.rb', line 768

def initialize(generator, id)
  @id = id
  super(generator, "$(#{id.to_json})")
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActionView::Helpers::JavaScriptProxy

Instance Method Details

#reloadObject



781
782
783
# File 'lib/action_view/helpers/prototype_helper.rb', line 781

def reload
  replace :partial => @id.to_s
end

#replace(*options_for_render) ⇒ Object



777
778
779
# File 'lib/action_view/helpers/prototype_helper.rb', line 777

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

#replace_html(*options_for_render) ⇒ Object



773
774
775
# File 'lib/action_view/helpers/prototype_helper.rb', line 773

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