I'm using the gem Carrierwave to upload pdf ; is working correctly when creating, but the drawback is when editing, if I save it takes me to show
and I get the following error:
No route matches [POST] "/ client / 5" (example).
The funny thing is that if I click on the url in the browser + enter , it addresses me well to show
.
In my routes.rb I have:
resources :clients
Code update
:
def update
@client = Client.find(params[:id])
if @client.update(client_params)
redirect_to clients_path
else
render 'edit'
end # end if
end # end update
Form: link
That also catches my attention, I do not understand why it redirects me to show
when I indicate that it goes to clients_path
.
Has something similar happened to someone?