:put} I\'m not sure why I am getting a routing error for a route that usually works." />
开发者

Rails: routing update error

开发者 https://www.devze.com 2023-01-21 14:22 出处:网络
I am getting a routing error: No route matches \"/deccom_tasks/update/1\" with {:method=>:put} I\'m not sure why I am getting a routing error for a route that usually works.

I am getting a routing error: No route matches "/deccom_tasks/update/1" with {:method=>:put}

I'm not sure why I am getting a routing error for a route that usually works.

Route:

 map.resources :decom_tasks, :collection => {:sort => :post, :deactivate_task => :get,  :reactivate_task => :get}

Controller:

 def update
    @task = Task.find(params[:id])

    respond_to do |format|
      if @task.update_attributes(params[:task])
        format.html { redirect_to(@task, :notice => 'Task was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @task.errors, :status => :unprocessable_entity }
      end
    end
  end开发者_如何学运维


Mark Thomas was right, syntax error

0

精彩评论

暂无评论...
验证码 换一张
取 消