PrototypeR4::Application.routes.draw do devise_for :users # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products resources :sites # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end namespace :admin do resources :assets resources :items do member do put :up put :down end end resources :layouts resources :designs do member do post 'edit_file' => 'designs#edit_file' get 'delete' end end resources :links do member do get 'delete' end end resources :pages do member do get 'delete' end end resources :page_parts resources :homes resources :snippets resources :translations resources :user_info_models resources :user_role_models end namespace :panel do resources :users end # Patch Mongo::GridIO to contain an each method. require File.join Rails.root, 'lib/grid_io' Mongo::GridIO.send(:include, PrototypeR4::GridIO) match "/gridfs/*path", :via => :get, :to => proc { |env| gridfs_path = env["PATH_INFO"].gsub("/gridfs/", "") begin gridfs_file = Mongo::GridFileSystem.new(Mongoid.database).open(gridfs_path, 'r') [ 200, { 'Content-Type' => gridfs_file.content_type, 'Content-Length' => gridfs_file.file_length.to_s }, gridfs_file ] rescue message = 'Grid file not found.' [ 404, { 'Content-Type' => 'text/plain', 'Content-Length' => message.size.to_s }, message ] end } match '*page_name' => 'pages#show', :as => :page, :constraints => lambda{|request| !request.path.starts_with?("/panel") } # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to => "welcome#index" root :to => 'pages#index' # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id(.:format)))' end