Created
May 8, 2012 16:44
-
-
Save Sephi-Chan/2637148 to your computer and use it in GitHub Desktop.
Generating routes VS Writing routes by hand
This file contains 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
Application::Application.routes.draw do | |
get '/my_favorites', to: 'favorites#my_index' | |
resources :users do | |
resources :favorites, only: [ :index ] | |
end | |
resources :favorites, only: [ :destroy ] | |
namespace :bookmarklet do | |
resources :favorites, only: [ :new, :create ] | |
end | |
end |
This file contains 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
Application::Application.routes.draw do | |
delete '/favorites/:id', to: 'favorites#destroy', as: 'favorite' | |
get '/users/:user_id/favorites', to: 'favorites#index', as: 'user_favorites' | |
get '/my/favorites', to: 'favorites#my_index', as: 'my_favorites' | |
get '/bookmarklet/favorites/new', to: 'bookmarklet/favorites#new', as: 'bookmarklet_new_favorite' | |
post '/bookmarklet/favorites', to: 'bookmarklet/favorites#create', as: 'bookmarklet_favorites' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment