我有此控制器:路由非問題的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