Links are just simple HTML a-tags. However, Ruby on Rails offers a powerful helper method, link_to, which makes writing links easier. This is especially helpful when working with routes, controllers, and actions because the target of the link can be specified using a string or a hash.
- [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 HTML is what we want to come up with in the end.…
- Creating and configuring a new Ruby on Rails project
- Generating controllers and views
- Handling server requests
- Using different types of routes
- Rendering and viewing templates
- Generating migrations and models
- Creating, updating, and deleting records
- Finding records with queries
- Understanding relationship types
- Writing controllers for CRUD
- Working with layouts and helpers
- Managing application assets
- Building forms
- Validating data
- Authenticating users
Skill Level Beginner
1. What Is Ruby on Rails?
2. Get Started
3. Controllers, Views, and Dynamic Content
4. Databases and Migrations
5. Models and ActiveRecord
7. CRUD, REST, and Resourceful Routes
8. Controllers and CRUD
9. Layouts, Partials, and View Helpers
12. Data Validation
13. Controller Features
14. User Authentication
15. Improve the Simple CMS
Next steps1m 44s
- 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.