Good afternoon, congratulations for the post, I'm a beginner in Rails, I reproduced your example but I'm not able to generate the rails messages in the view; json render appears; but when I remove the json nothing happens; what do I need to change in your example? do I need to install the stimulus ( rails webpacker:install: stimulus) ?
if the json you remove is in the users_controller that you remove, you need to add new error renderer. like this example generated from rails g scaffold
respond_to do |format|
if user.save(user_params)
format.html { redirect_to users_path, success: "Success " }
format.json { render :show, status: :ok, location: @gender }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: user.errors, status: :unprocessable_entity }
end
end
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good afternoon, congratulations for the post, I'm a beginner in Rails, I reproduced your example but I'm not able to generate the rails messages in the view; json render appears; but when I remove the json nothing happens; what do I need to change in your example? do I need to install the stimulus ( rails webpacker:install: stimulus) ?
if the json you remove is in the users_controller that you remove, you need to add new error renderer. like this example generated from rails g scaffold