Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Peter Krnjevic's Profile

GitHub User: pkrnjevic

Site: krnjevic.com/wp

Comments by Peter Krnjevic

Avatar

Hi Ryan,

Thanks for all the great RailsCasts - I'm learning a ton of stuff!

I'm using your adding/deleting field partials fairly extensively and ran into a couple of things others may find useful:

  1. Your .gsub('\n','') removing newlines causes slight horizontal shifting of fields on inline forms. This was easily fixed by escaping rather than removing newlines using .gsub('\n','&#xA').

  2. jQuery won't recognize events from controls created this way. Apparently the solution is to use .on() (formerly .live and .delegate) though I have yet to try this.

Thanks again for all your great tutorials and keep up the good work.

Cheers,
Peter