2011-11-09 24 views
0

私はすべてのルートをキャッチするために次のエントリを持っている私のroutes.rbファイルでのRails 3でシンプルなCMSを作成しています:私は、エディタのサポートのためにckeditor宝石を使用していRails3ルーティングの優先順位

match '*url', :controller => 'site', :action => 'dynamic_page' 

。次のように私のrake routesがある:

     root  /(.:format)        {:action=>"index", :controller=>"site"} 
           /*url(.:format)       {:action=>"dynamic_page", :controller=>"site"} 
     ckeditor_pictures GET /ckeditor/pictures(.:format)    {:action=>"index", :controller=>"ckeditor/pictures"} 
     ckeditor_pictures POST /ckeditor/pictures(.:format)    {:action=>"create", :controller=>"ckeditor/pictures"} 
     ckeditor_picture DELETE /ckeditor/pictures/:id(.:format)   {:action=>"destroy", :controller=>"ckeditor/pictures"} 
ckeditor_attachment_files GET /ckeditor/attachment_files(.:format)  {:action=>"index", :controller=>"ckeditor/attachment_files"} 
ckeditor_attachment_files POST /ckeditor/attachment_files(.:format)  {:action=>"create", :controller=>"ckeditor/attachment_files"} 
ckeditor_attachment_file DELETE /ckeditor/attachment_files/:id(.:format) {:action=>"destroy", :controller=>"ckeditor/attachment_files"} 

私の問題は、あなたが見ることができるよう、次のとおりです。CKEditorバージョンルートひいてはCKEditorバージョンルートの前に

/*url(.:format)  {:action=>"dynamic_page", :controller=>"site"} 

..loadsが機能していません。前にckeditorのルートを読み込んでいる人に助けてもらうことができます:

/*url(.:format)  {:action=>"dynamic_page", :controller=>"site"} 

ありがとうございます。

答えて

1

ソリューションは、その作業罰金

1

ルートファイルは上から順に処理されるため、キャッチオールがckeditorの後にくるようにルートの順序を変更してください。私が思いついた

+0

こんにちは@Richardは、今、この

namespace :ckeditor, :only => [:index, :create, :destroy] do resources :pictures resources :attachment_files end match '*url', :controller => 'site', :action => 'dynamic_page' 

のように手動でroutes.rbファイルへの回答に感謝を

をCKEditorバージョンのルートを追加していますが、問題は 'ckeditor'ルートが 'ckeditor'宝石のルートから来ていることです。しかし、私の他のルーティングはすべてconfig/routes.rbにあります。 – sameera207

関連する問題