JC: fixed bug in new and edit with ERB. Refectoring views.
JC: more cn.