Created
February 19, 2013 08:16
-
-
Save Locke23rus/4983968 to your computer and use it in GitHub Desktop.
Rails routes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Стандартные роуты для collection | |
| # pages GET /pages(.:format) pages#index | |
| # POST /pages(.:format) pages#create | |
| # new_page GET /pages/new(.:format) pages#new | |
| # | |
| # Стандартные роуты для member | |
| # edit_page GET /pages/:id/edit(.:format) pages#edit | |
| # page GET /pages/:id(.:format) pages#show | |
| # PUT /pages/:id(.:format) pages#update | |
| # DELETE /pages/:id(.:format) pages#destroy | |
| # | |
| # Кастомные роуты для collection | |
| # search_pages GET /pages/search(.:format) pages#search | |
| # my_pages GET /pages/my(.:format) pages#my | |
| # | |
| # Кастомные роуты для member | |
| # approve_page PUT /pages/:id/approve(.:format) pages#approve | |
| # disable_page PUT /pages/:id/disable(.:format) pages#disable | |
| resources :pages do | |
| member do | |
| put :approve | |
| put :disable | |
| end | |
| collection do | |
| get :search | |
| get :my | |
| end | |
| end | |
| # collection - роуты в этом блоке указывают на коллекцию объектов, указанных в ресурсе. | |
| # member - роуты в этом блоке указывают на конкретный объект из ресурса. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment