Method: Nitro::AutoCompleteMorpher#before_start

Defined in:
lib/nitro/helper/javascript/morphing.rb

#before_start(buffer) ⇒ Object



144
145
146
147
148
149
150
151
152
153
# File 'lib/nitro/helper/javascript/morphing.rb', line 144

def before_start(buffer)
  require_script_file :prototype, :effects, :controls
  
  id = @id = @attributes['id'] || @attributes['name']    
  update = @attributes['auto_complete_update'] || "#{id}_auto_complete"
  url = @attributes['auto_complete_url'] || "#{id}_auto_complete"    
  js "new Ajax.Autocompleter('#{id}', '#{update}', '#{url}');"

  @attributes.delete(@key)
end