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

Rails: routing update error

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜