I am submitting form with data-remote=true attribute. The create action in the controller looks like:
format.js { @user }
and it is handled by the following template:
create.js.erb
Is there an easy way to render the @user.errors messages like JSON in order to used the following JSON in the current template and handle the errors then?
I know that I can render the errors using format.json directive but I want to make and other JavaScript manipulation, not only render the errors and because of this I am using the format.js tehnique.