开发者

route index for a resource

开发者 https://www.devze.com 2023-04-10 05:24 出处:网络
What is the equivalentindex path for resources :topics if I were to write it out manually? When I run rake routes with the resources line in t开发者_开发技巧he routes.rb file it shows.

What is the equivalent index path for resources :topics if I were to write it out manually?

When I run rake routes with the resources line in t开发者_开发技巧he routes.rb file it shows.

    GET    /topics(.:format)         {:action=>"index", :controller=>"topics"}

I have tried a few things with no success, for example:

    get 'topics/index' #=> 'topics#index'


as the route says:

get "/topics" => "topics#index", :as => :topics

you can now use topics_path or topics_url

0

精彩评论

暂无评论...
验证码 换一张
取 消