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.



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

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



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

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

#replace(*options_for_render) ⇒ Object



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

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

#replace_html(*options_for_render) ⇒ Object



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

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