Embed presentation
Download to read offline



![routing (routes.rb)
General rules
root 'pages#main'
get '/patients/:id', to:
‘patients#show’
match 'photos', to: 'photos#show',
via: [:get, :post]
resources and nested resources
url_for
member and collection](https://image.slidesharecdn.com/rails04-150918090120-lva1-app6891/75/Rails-course-day-4-4-2048.jpg)

![routing(routes.rb)
get ‘:controller/:action/:id/with_user/:user_id'
Naming routes (as:)
via: [get, post or all]
constraints: { subdomain: 'admin' }
can save your life
get 'books/*section/:title', to: ‘books#show'
mount AdminApp, at: ‘/admin’
get 'こんにちは', to: 'welcome#index'](https://image.slidesharecdn.com/rails04-150918090120-lva1-app6891/75/Rails-course-day-4-6-2048.jpg)

![Controller
(Params)
Hash, Array and JSON Parameters
GET /clients?ids[]=1&ids[]=2&ids[]=3
def default_url_options
{ locale: I18n.locale }
end
Strong paramaters](https://image.slidesharecdn.com/rails04-150918090120-lva1-app6891/75/Rails-course-day-4-8-2048.jpg)





The document outlines the agenda for Day 4 of a Ruby on Rails course focusing on routing, controllers, and views. It discusses general routing rules, naming routes, and controller actions, as well as providing tips for using Rails generators and managing user sessions. The content includes technical details about RESTful routes, strong parameters, and handling different types of requests.



![routing (routes.rb)
General rules
root 'pages#main'
get '/patients/:id', to:
‘patients#show’
match 'photos', to: 'photos#show',
via: [:get, :post]
resources and nested resources
url_for
member and collection](https://image.slidesharecdn.com/rails04-150918090120-lva1-app6891/75/Rails-course-day-4-4-2048.jpg)

![routing(routes.rb)
get ‘:controller/:action/:id/with_user/:user_id'
Naming routes (as:)
via: [get, post or all]
constraints: { subdomain: 'admin' }
can save your life
get 'books/*section/:title', to: ‘books#show'
mount AdminApp, at: ‘/admin’
get 'こんにちは', to: 'welcome#index'](https://image.slidesharecdn.com/rails04-150918090120-lva1-app6891/75/Rails-course-day-4-6-2048.jpg)

![Controller
(Params)
Hash, Array and JSON Parameters
GET /clients?ids[]=1&ids[]=2&ids[]=3
def default_url_options
{ locale: I18n.locale }
end
Strong paramaters](https://image.slidesharecdn.com/rails04-150918090120-lva1-app6891/75/Rails-course-day-4-8-2048.jpg)



