From the course: Ruby on Rails 6 Essential Training
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Challenge: Dynamic templates - Ruby on Rails Tutorial
From the course: Ruby on Rails 6 Essential Training
Challenge: Dynamic templates
(upbeat music) - [Instructor] It's time for a challenge assignment. In this challenge, you're going to use what you've learned about dynamic templates. There's several objectives that I'd like you to try to complete. The first is that in the DemoController, we want to add a couple of new actions, #about and #contact. The ash or pound sign that's in front of each of those words is a convention for how we write Ruby method names. So those indicate that this is a Ruby method inside the DemoController class. Of course, once you create these actions, you'll also need a route to route requests to those actions and we're going to need some templates but our templates aren't going to be called #about and #contact. I want you to name them about_us and contact_us. So you'll need to create new files for those and make those work with our controller actions. You'll also want to write some HTML and text for those templates.…
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
-
-
-
-
-
Render a view template for a browser5m 35s
-
Redirect controller actions5m 13s
-
Define view templates using HTML5m 34s
-
Use instance variables to set values in the template3m 42s
-
Create links to other webpages4m 17s
-
Defining and reading URL parameters6m 38s
-
Challenge: Dynamic templates3m 22s
-
Solution: Dynamic templates6m 9s
-
-
-
-
-
-