In this solution to the challenge assignment, I demonstrate how I used routes and templates to convert a simple HTML website into a Sinatra web application.
(chimes ring)…- [Teacher] In this movie,…I'll show you the solution that I came up with…to the template challenge I gave you.…So the very first thing that I did…was I moved all of those files.…I just went in to the desktop environment,…grabbed the files and drug them into my views.…That made them go from the static directory…to the template directory.…And then I changed all of the file names…that the file extension was .erb…instead of .html.…I went through and I did that…for every single one of these files.…
Once I had done that, I came into…sinatra.rb and I added routes for each one.…So I went through each one, contact…explorers, mission and so on.…And each one needs to render the right template.…Erb contact, erb explorers, and so on.…I also while I was doing that,…went through and added the page…title for each one.…I went to the actual old file,…the old template to see what it was called…and just copied and pasted that in here…so I would have it preserved.…Now that'll populate the page title.…So that was all fairly straightforward…
- Installing Sinatra
- Launching the server
- Defining routes
- Using route patterns and parameters
- Redirecting requests
- Rendering dynamic templates
- Using partial templates and layouts
- Defining custom helpers
Skill Level Intermediate
Ruby on Rails 5 Essential Trainingwith Kevin Skoglund10h 21m Beginner
3. Helpers and Filters
4. Useful Techniques
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.