Ruby on Rails provides many helper methods to make common tasks in the view templates easier. Learn how to use word_wrap, simple_format, truncate, pluralize, truncate_words, highlight, and excerpt.
- Rails provides many Helper methods…to make common tasks in our View templates easier.…In this movie, we'll take a quick look at some…of the most useful Text Helpers.…We're going to be looking at word_wrap, simple_format,…truncate, and pluralize.…These should give you a feel for how Text Helpers work,…and how they can help you.…Word_wrap is used when you have long sections of text.…That might just be text that you have stored in a variable,…or, more likely, it's probably text…that you pulled back from the database.…We want to wrap that text so that it's no longer…than a certain line length.…
So we use word_wrap.…We provide the text…as the first argument, and then,…if we want we can specify the line width that we want.…It's going to be 80 by default.…You can see here I've got it set to 30.…What word_wrap does then is it breaks each line…on the first white space character…which does not exceed the line width.…It does not break up words.…So you can see here, each of the words is intact,…and then at the end of each line there is a "slash n".…
- 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.