I’m creating a simple CMS with Rails 3. In my routes.rb file I have the following entry to catch all routes:
match '*url', :controller => 'site', :action => 'dynamic_page'
I’m using ckeditor gem for editor support. My rake routes is as follows:
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"}
My problem is, as you can see:
/*url(.:format) {:action=>"dynamic_page", :controller=>"site"}
..loads before the ckeditor routes and hence ckeditor routes are not working. Can someone help me out on loading ckeditor routes before:
/*url(.:format) {:action=>"dynamic_page", :controller=>"site"}
Thanks in advance.
The solution I came up with is adding the ckeditor routes to the
routes.rbfile manuallylike this
Now its working fine