courses_path
此路径生成网址:
http://localhost:3000/courses
友好的网址:
resources :courses, :only => [:index] do
get 'page/:page', :action => :index, :on => :collection
end
当我想要paginate很多课程时,网址输出类似于:
http://localhost:3000/courses/page/2
http://localhost:3000/courses/page/3
http://localhost:3000/courses/page/4
.
.
.
对于第一页,网址为courses_path
或courses_url
http://localhost:3000/courses
kaminari生成的每个页面的链接助手是什么?
答案 0 :(得分:2)
您可以尝试以下配置:
get '/courses(/page/:page)' => 'courses#index', :as => :courses, :page => 1