From the course: Ruby on Rails 5 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Links - Ruby on Rails Tutorial
From the course: Ruby on Rails 5 Essential Training
Links
- [Instructor] We now understand how a single request response cycle works, from the browser request all the way to the return HTML page. So far, we've been testing these out by typing the URL into the browser. What we need now are the ability to create links we can put into our templates so that the user can click a link to initiate a new request. In this movie, we'll learn how to create links in Rails. This is a basic HTML link. The text that we want to display for the link is inside the <a> tags. In this case, it's the words "index page." And the link URL is inside the double quotes right after href equals. So, in this case, it's slash demo slash index. This link would display the text "index page" and, when we clicked on it, it would take us to the page demo index. We can absolutely use this basic HTML link inside our templates. There's nothing wrong with it. It will do what we expect. It's just HTML. And anything that we do in Rails using ERB is going to result in HTML anyway. So…
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.