在rails3中禁用:.format路由 [英] Disable :.format routes in rails3

查看:233
本文介绍了在rails3中禁用:.format路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你能告诉我如何禁用轨道路线中的。:格式选项吗?我只需要html ...

解决方案

在3.1.1中至少可以添加:format => false 到路由的结尾。



在这里找到: http://guides.rubyonrails.org/routing.html#request-based-constraints 根据第3.11节中的
路由Globbing



例如..

  match'* pages'=> 'pages#show',:format =>假

哪一个可以让params [:pages]包含一个句号。


Could you tell me how to disable the .:format options in rails routes? I only need html...

解决方案

In 3.1.1 at least you can add , :format => false to the end of the route.

Found here: http://guides.rubyonrails.org/routing.html#request-based-constraints under section 3.11 Route Globbing

eg..

match '*pages' => 'pages#show', :format => false

Which would allow params[:pages] to include a period.

这篇关于在rails3中禁用:.format路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆