From the course: Ruby on Rails 6 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Define routes in a Ruby on Rails project - Ruby on Rails Tutorial
From the course: Ruby on Rails 6 Essential Training
Define routes in a Ruby on Rails project
- [Instructor] In this movie, we will learn how Rails routing works. We saw the Rails architecture. If a web server can't find a static file in the public directory that matches the current request, then it sends the request on to the routing portion of the Rails framework. Rails routing examines the URL to determine which controller and action should be called. It does that using the definitions in the applications routes file. There is several types of route definitions. There's the simple match route. There's the default route. There's the root route and resourceful routes. We'll discuss the first three now and save the last one until later. The routes file is stored in config/routes.rb and if you look there now, you'll see an example of a simple match route because it was created when we generated our controller and view earlier. It says get and inside quotes, demo/index. This is a shorthand. The longer…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Create a new Ruby on Rails project3m 56s
-
Examine the file structure of a Ruby on Rails project4m 55s
-
(Locked)
Configure a Ruby on Rails project7m 2s
-
(Locked)
Access a Ruby on Rails project from a browser2m 25s
-
(Locked)
Generate a controller and view5m 24s
-
(Locked)
Examine how server requests are handled5m 43s
-
(Locked)
Define routes in a Ruby on Rails project7m 17s
-
(Locked)
Challenge: Experiment1m 15s
-
(Locked)
-
-
-
-
-
-