Method: Nitro::ClientMorpher#before_start

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

#before_start(buffer) ⇒ Object



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/nitro/helper/javascript/morphing.rb', line 99

def before_start(buffer)
  require_script_file :prototype, :effects
  
  params = @attributes['params']

  case @name
  when 'form'
    @attributes['onsubmit'] = "__nc_#@value(#{params}); return false"
  else
    @attributes['href'] = '#'
    @attributes['onclick'] = "__nc_#@value(#{params}); return false"
  end
  @attributes.delete(@key)
  @attributes.delete('params')
end