Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby routes

get '/patients/:id', to: 'patients#show'

get '/patients/:id', to: 'patients#show', as: 'patient'

resources :brands, only: [:index, :show] do
  resources :products, only: [:index, :show]
end

resource :basket, only: [:show, :update, :destroy]

resolve("Basket") { route_for(:basket) }

root to: 'pages#main'
root 'pages#main' # 上の省略形
Source by railsguides.jp #
 
PREVIOUS NEXT
Tagged: #ruby #routes
ADD COMMENT
Topic
Name
8+5 =