I created a new action on the ClientsController called update_establishments. I have a form for Client which I want to call that action without generating a new view. The action will generate a new view.
clients_controller.rb def update_establishments create_zip respond_to do |format| if @client.update(client_params) set_zip format.html { redirect_to @client, notice:'Estabelecimento adicionado com sucesso.'} format.json {head :no_content} else format.html { render action: 'edit'} format.json { render json: @client.error, status: :unprocessable_entity } end end end clients/_locations_form.html.erb form_for @client, :url=>{:action=>'update_establishments'} do |form| %> ... this throws an error ActionController::UrlGenerationError in Clients#add_establishments with the explanation No route matches {:action=>"update_establishments", :id=>"35", :controller=>"clients"}
I made no changes on the routes.rb
Do I need to create a view called clients/update_establishments to make this work?