DRY respond_to

rescue NoPost, ActiveRecord::RecordInvalid ?

Ah sorry, didn’t notice. There’s not much to DRY tho in that case. Try this:

rescue NoPost, ActiveRecord::RecordInvalid
[…]
type.js { render :action => ($!.is_a? NoPost) ? :new : :create }

Just typing this out, but some variation of that will work.

Vish