【发布时间】:2012-01-23 22:36:59
【问题描述】:
coachings GET /coachings(.:format) {:action=>"index", :controller=>"coachings"}
POST /coachings(.:format) {:action=>"create", :controller=>"coachings"}
new_coaching GET /coachings/new(.:format) {:action=>"new", :controller=>"coachings"}
edit_coaching GET /coachings/:id/edit(.:format) {:action=>"edit", :controller=>"coachings"}
coaching GET /coachings/:id(.:format) {:action=>"show", :controller=>"coachings"}
PUT /coachings/:id(.:format) {:action=>"update", :controller=>"coachings"}
DELETE /coachings/:id(.:format) {:action=>"destroy", :controller=>"coachings"}
我的路线是正确的,这是我的视图索引
:destroy %>
这是我的控制器
def destroy
@coaching = Coaching.find(params[:id])
@coaching.destroy
respond_to do |format|
format.html { redirect_to coachings_path }
format.json { head :ok }
end
end
任何想法为什么我会收到此错误?我是 RoR 的新手,这是我自己完成的第一个项目。
【问题讨论】:
标签: ruby-on-rails ruby destroy