carrierwave when editing does not find the route

0

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

rails routes

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?

    
asked by Eragon 15.12.2017 в 00:30
source

1 answer

0

The problem was in :method => "post" in form , it has to be put or simply removing it, because if I put put does not work for create .

    
answered by 16.12.2017 / 23:44
source