0
我正在寫一個會議列出的Rails的網站,以及跨越這個要求就來了:在Rails中路由鏈接?
鏈,在沒有特定的順序,一個URL找到的事件,如:
/中/:城市/上/:標籤/與/:揚聲器
或重新像
/中/:城市/與/:揚聲器/上/:標籤
我可以處理這些細微一個接一個。有沒有辦法動態處理這些請求?
routes.rb中:
map.connect '/:type/*facets', :controller => 'events', :action => 'facets'
events_controller.rb:
def facets
@events = find_by_facets(params[:facets], params[:type])
render :action => "index"
end
application_controller.rb