相关疑难解决方法(0)

使用Rails 3的动态路由

我有一项任务是根据路由模型开发rails应用程序.

我需要PageControllerPage模型.页面网址必须像/contacts, /shipping, /some_page.

我也需要CatalogControllerCategory模型.类别网址必须是这样的/laptops, /smartphones/android.

它将是ProductsControllerProduct模型,产品的网址必须是线/laptops/toshiba_sattelite_l605,/smartphones/android/htc_magic

我知道这个问题可以通过使用URL来解决

  • /page/shipping
  • /catalog/smartphones/android

但客户不希望在URL中看到" /page"或" /catalog" 的插入.

请告诉我解决这个问题的方向.对不起,我的英语不好.

ruby ruby-on-rails url-routing ruby-on-rails-3

13
推荐指数
1
解决办法
1万
查看次数