X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=config%2Froutes.rb;h=8b7c093134888028210fb545f09d55994980fe03;hb=2ef6906763f81b88a2a82e84e78e0ba3918c22a8;hp=7754dd1c3cfa886b5ed17c33e10ac332d87816e2;hpb=87b29f4f401626c3b21df387cf7cd75677ea56cf;p=feedcatcher.git diff --git a/config/routes.rb b/config/routes.rb index 7754dd1..8b7c093 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,57 +1,61 @@ -ActionController::Routing::Routes.draw do |map| +Feedcatcher::Application.routes.draw do # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". - # Sample of regular route: - # map.connect 'products/:id', :controller => 'catalog', :action => 'view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # map.resources :products - - # Sample resource route with options: - # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } - - # Sample resource route with sub-resources: - # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller + # You can have the root of your site routed with "root" + # root 'welcome#index' + root 'feed#index' - # Sample resource route with more complex sub-resources - # map.resources :products do |products| - # products.resources :comments - # products.resources :sales, :collection => { :recent => :get } + get 'index', to: 'feed#index', as: :index + get ':feed_name', to: 'feed#show', as: :feed + post '', to: 'feed#update', as: :update + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end # end - # Sample resource route within a namespace: - # map.namespace :admin do |admin| - # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) - # admin.resources :products + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller # end - map.index 'index.:format', - :conditions => { :method => :get }, - :controller => 'feed', - :action => 'index' - map.feed ':feed_name.:format', - :conditions => { :method => :get }, - :controller => 'feed', - :action => 'show' - map.update ':feed_name', - :conditions => { :method => :post }, - :defaults => { :feed_name => nil }, - :controller => 'feed', - :action => 'update' - - # You can have the root of your site routed with map.root -- just remember to delete public/index.html. - map.root :controller => "feed" - - # See how all your routes lay out with "rake routes" - - # Install the default routes as the lowest priority. - # Note: These default routes make all actions in every controller accessible via GET requests. You should - # consider removing the them or commenting them out if you're using named routes and resources. -# map.connect ':controller/:action/:id' -# map.connect ':controller/:action/:id.:format' + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end end