Module: JQueryOnRails::Helpers::JQueryHelper::JavaScriptGenerator::CompatibilityMethods

Defined in:
lib/jquery_on_rails/helpers/jquery_helper.rb

Instance Method Summary collapse

Instance Method Details

#[](id) ⇒ Object



238
239
240
241
242
243
244
245
246
247
# File 'lib/jquery_on_rails/helpers/jquery_helper.rb', line 238

def [](id)
  case id
  when String, Symbol, NilClass
    proxy = JavaScriptElementProxy.new(self, id)
  else
    proxy = JavaScriptElementProxy.new(self, ActionController::RecordIdentifier.dom_id(id))
  end
  Object.instance_method(:extend).bind(proxy).call JavaScriptElementCompatibility
  proxy
end