我有此控制器:路由非问题的REST控制器
gods_controller.rb
class GodsController < ApplicationController
def notifications
@reviews= Review.where("flag = ?", true)
respond_to do |format|
format.html # index.html.erb
end
end
end
的routes.rb
resources :gods, :only => [:index] do
get :notifications
end
这条路给我:http://example.com/gods/1/notifications
但我想要的是:http://example.com/gods/notifications
在此先感谢!
十分感谢这正是我所需要的 – 2013-04-03 20:22:09