16th Tue
[Rails]URIのセパレータを追加する方法
This article was migrated from http://rails.office.drecom.jp/takiuchi/archive/156
Railsでは、config/routes.rbファイルでURIとコントローラ&アクションのマッピングを行いますが、URIを分解してセグメントに分けるためのセパレータは、デフォルトでは次の文字になっています(Rails-1.2RC1)
ActionController::Routing::SEPARATORS => ["/", ";", ".", ",", "?"]セパレータとなる文字を追加するためには、config/environment.rbの中で、ActionController::Routing::SEPARATORSに要素を追加すればOKです。
ActionController::Routing::SEPARATORS << '@'これでconfig/routes.rbのなかで'@'をセパレータとして使用することができます。
This article was migrated from http://rails.office.drecom.jp/takiuchi/archive/156
posted by
genki on Tue 16 Jan 2007 at 15:26 with 0 comments