Maybe try using formtastic in here. makes your life easier especially for the Category stuff