Join Kevin Skoglund for an in-depth discussion in this video Why use Ruby on Rails?, part of Ruby on Rails 3 Essential Training.
Now that we have understood what Ruby on Rails is, let's talk about why you would want to use Ruby on Rails as a web application framework? The best thing about Ruby on Rails is the Ruby programming language. Ruby is just a real pleasure of a language to work with. It's object-oriented. It's easily readable. It has unsurprising syntax and behavior. It's just a great language to build a web application framework with. Rails is also designed with two guiding principles that help to make it powerful and effective. The first of those is DRY code. Now I am always going to pronounce that as "dry," but it's actually three letters, DRY, which stands for Don't Repeat Yourself.
And it's a fundamental principle of software design that says that every piece of information should be expressed in just one place, and it makes sense that the easiest code to maintain is going to be DRY code, because duplication can lead to inconsistency, can make our code unclear, and can make it harder to maintain and update. So we going to end up with concise consistent code that's easy to maintain if we follow this DRY principle, and Rails was built using that principle and it's going to encourage us through the way it's structured to follow that as well.
So just keep that in mind that it is the mantra of working in Rails is, is your code DRY? We want to encourage that habit in ourselves. The second important principle is that of convention over configuration. Rails is built using sensible defaults and those defaults are what are there, unless we override them. So we only specify the unconventional aspects, the things that are different for us, and that's going to speed up our development, right, because most of the time we can sort of ride on those defaults to get most of the way there, and only write code for the things that are different, and that gives us less code to maintain as well.
The other thing about the convention and sensible defaults of Rails is that it is going to follow best practices of web application development. So we are going to have these best practices built-in. They are going to be right there ready for us to take advantage of, which is great. It's going to also help our code be better and our end-product be better. Now the one thing you need to be aware of though is that it is opinionated about what those best practices are. 99% of the time it's not a controversial thing, everyone agrees on what the best practices are, but there are some rare cases where there might be two competing things for what's the best way to do something and Rails has taken a stand in most cases and said, "This is the way Rails is going to do it." You can still configure it to do it a different way, but by default the sensible default built-in will be what it thinks is there.
So just be aware of that. The other great thing about these sensible defaults that are built in to the framework is that a lot of time we get extra features for free. Maybe we only need feature A and B right now, but down the road feature C is there just waiting for us. Just built into the framework and all we have to do is start using it. And that's great. It pays a lot of dividends down the road as we continue to grow and expand our web applications with new features. So who should use Ruby on Rails? Let's say just about anyone can use Ruby on Rails, but the people who are going to get most benefit out of it are going to be developers who have some previous web experience, so they already understand a lot of the way the to the web works, and maybe they have been building sites already that interact with databases and they are tired of creating and re-creating site functionality from scratch.
They are going to drive a big benefit out of switching to work with a framework, instead of writing everything from scratch all the time. And it is also for the people who are concerned about best practices, web standards and web security. Rails is going to help us with all of those things. And last of all, for developers who are not afraid with the command line. With Rails, it's going to be quite a bit of working from the command line, more so than if you say have been working in PHP. So you have to be ready to embrace that as you dive into Ruby on Rails. Now, lots of people wonder what the prerequisites are to learning Ruby on Rails, to diving into this framework.
I would say that the first thing is you want to make sure that you have the web basics down already, that you understand the way browsers work and web servers work and pages. You don't need all the intricacies or anything, but just have a fundamental understanding of how the web and web pages work. You also need to understand HTML. It is the fundamental language of the web and everything we do in Ruby on Rails is going to output HTML. So you want to make sure you understand HTML. It's essential. I think is also good for you to have a good understanding of SQL. Now, you don't need to be an expert, but you need to have some essential SQL under your belt. Even though Ruby on Rails is going to write a lot of the SQL for you, the concepts are still there and it's important to have an understanding of what it means to join two tables together using a foreign key.
We can dip our toe in the water with Ruby on Rails and we can bumble our way through it and get around just fine, and have a perfectly nice visit, but if we really want to use Ruby on Rails, then you are going to have learn Ruby, because it is the fundamental building block that it is based on.
- Understanding MVC (Model View Controller ) architecture
- Routing browser requests through the framework
- Responding to requests with dynamic content
- Defining associations and database relationships
- Creating, reading, updating and deleting records
- Working with forms
- Validating form data
- Reviewing built-in security features
- Authenticating users and managing user access
- Debugging and error handling
Skill Level Beginner
1. What Is Ruby on Rails?
2. Installing Ruby on Rails on a Mac
3. Installing Ruby on Rails on a Windows Machine
4. Getting Started
5. Controllers, Views, and Dynamic Content
6. Databases and Migrations
7. Models, ActiveRecord, and ActiveRelation
9. Controllers and CRUD
10. Layouts, Partials, and View Helpers
12. Data Validation
13. User Authentication
14. Improving the Simple CMS
15. Debugging and Error Handling
16. Introducing More Advanced Topics
- 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.