Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Trying to learn Rails, but it is too hard...

I want to build a website using Ruby on Rails, because I thought already knew a decent amount of Ruby, so it wouldn't be so hard to learn. So then I switched over to the Ruby on Rails track, nodding my head throughout the course on Sinatra.

Then, I started the introductory Rails course. But unfortunately, it simply was just too hard for me to understand. There are so many things unexplained, as the scaffold generator generates a lot of files, but Jay McGavren doesn't talk about 80% of the stuff. So every time I write Ruby, I feel like I'm trudging through loads of unexplained code, and eventually I just gave up.

Should I simply ignore all of those other files/code? Or should I rewatch the videos over and over again? I still would very much like to learn Rails, but it simply is too much.

Help appreciated! ~Alexander Davison

1 Answer

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

hi, Alexander, let me offer you some advice here.

If you're able to follow along w/ the Sinatra course, that's a pretty good indication that you have the required knowledge to start learning Rails.

But here's the thing you need to understand. Sinatra is an unopinionated, minimalist web framework. When writing a web app in Sinatra, you pretty much have to write every single line of code yourself to make the web application works. That's why when taking the Sinatra course, it's kinda easy to follow along from lesson to lesson, because you're starting from the ground up, and Sinatra is not giving you extra help in writing the web app.

Rails take a different approach, it's a very opinionated & full-featured web framework, Rails has the convention over configuration philosophy, meaning this web framework comes w/ many configuration decision bundled in, and thereby allows developers to skip writing a lot of setup/configuration & boilerplate code as long as you follow certain Rails convention (e.g. naming the variable in certain ways). In a sense, a lot of what Rails do seems like black box magic, especially to people who're new to back-end development. scaffolding is one example of that, one line of command generates all the necessary files for a working web application, you said Jay didn't explain what those files are for? I'm not so sure he can explain 'em in a manner that makes sense to Rails newcomer, but as you gain more experience in Rails, you'll certainly understand what those files are.

Also, I didn't take that course, but did Jay talk about MVC (a.k.a Model-View-Controller) pattern during the course? When using Sinatra, you can write the web app however you want; In Rails land tho, you'll have to do things in Rails way, and Rails way of writing Web app is by using the MVC pattern. Having a good understanding of MVC is pretty important for learning Rails.

I can recommend couple extra learning resources for you.

  • Learn Ruby on Rails: Book One -- I really believe this good book bridges the education gap going from Sinatra -> Rails, few Rails books on the market go into such depth on explaining how each command & each line of code works every step of the way while writing a Rails app. It's very beginner friendly.
  • The MVC Pattern in Ruby this free course teaches what MVC design pattern is.

Hope that helps, happy coding.