The Intro to Rails Screencast I Wish I Had
videos

The Intro to Rails Screencast I Wish I Had

Tutorial Details
  • Subject: Ruby on Rails
  • Difficulty: Beginner
  • Format: 40 Minute Screencast

Isn’t it funny how most “introduction to Ruby on Rails” screencasts are overly simplistic, and rely on generators like scaffolding? The teacher typically follows up the tutorial by stating that most Rails developer don’t use scaffolding generators. Well that’s not much help then! I’d like to give you the tutorial I wish I had. Along the way, we’ll also rely heavily on test-driven development to build a simple app.

Choose HD for the clearest picture.

Covered in this Screencast…

  • Create models and generators
  • Use test-driven development to plan and test an application’s features
  • Work with ActiveRecord
  • Autotest with Guard
  • Use Rspec and Capybara to simulate the user.
  • Create partials
  • Take advantage of Flash notices
  • …and plenty more

Conclusion

If you watched the entire screencast, I hope you enjoyed it! There’s certainly much more to cover, but we crammed a great deal into thirty minutes or so! What other tricks and techniques have you picked up, if you’re just digging into Rails?

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • https://twitter.com/the_eduist Edu

    How are is your data staying persistent in your db? When i test in the browser, the data is gone. doesn’t rspec clear the data for each test? Is your server operating from the test or development database in this tutorial? Thanks for the awesome tut!

  • CescQuintero

    Thanks for sharing!!

  • Drekonus

    I’ve been looking forward to starting this tutorial all week. Now, only 5 minutes into the screencast I am at a wall. When I run ‘guard’ in the terminal, the output looks nothing like that in tutorial. I’m given dozens of lines of LoadErrors. I’ve tried reinstall guard and a few other gems with no luck. Would anyone like to debug with me? It would be greatly appreciated!

    • jtr

      try running gem install guard to install guard

  • Javier

    Jeffrey thanks to you I FINALLY grasped REST in Rails.

    Thanks a lot man, you rule.

  • http://www.facebook.com/robbie.guilfoyle Robbie Guilfoyle

    Hi Jeff,

    I believe this tutorial could have used a monologue with code snippets, ROR is such a tedious learning curve and a lot of things are not explained well in any tutorial not just yours. Coming to ROR with TDD for the first time was a large learning curve and I think that all the extra errors made it even harder when migrating. Maybe a monologue would have made it easier to add notes into this where the errors are occurring with new versions and offering fixes. In any event great tutorial just a few complains, thanks for doing this :)

  • Carolus82

    There’s a problem with your flash plugin and Google Chrome on Ubuntu. Once you lose focus of the windows, it exits full screen mode. It makes impossible to follow the course, while coding, because the default video size is really small.

    • Carolus82

      Im sorry, I wanted to say flash video player, not flash plugin.

      • http://www.facebook.com/amccabe Alex McCabe

        ctrl++ zooms in

  • http://www.facebook.com/austinandrewvoss Austin Voss

    After taking several courses which used scaffold, this tutorial was EXACTLY what I needed to be confident with rails. THANK YOU!

  • http://www.facebook.com/muyiwa.matuluko Muyo-san Matuluko

    You lost me from the rails g section after running bundle install for the new gems added to Gemfile. I kept getting error messages, nothing is working. I’ve tried on both Windows and Ubuntu. Is this a Mac-only tutorial?

  • http://www.RandomITstuff.com/ Darren Cato

    This is a very good tutorial but much has changed with the setup over the past year. I spent about half a day trying to get it to work on ubuntu and then gave up and pulled out my mac. I fared better on that os, but there were still a number of road blocks. Once all the gems are loaded properly, the tutorial is pretty solid.

  • http://www.streamhead.com Peter Backx

    Quick note: if you are using slightly newer version of some of the libraries used in the video, you’ll run into issues with the Capybara DSL. You’ll get an “undefined method visit” error. The issue is documented here: https://github.com/rspec/rspec-rails/issues/360

    The easiest solution is adding “config.include Capybara::DSL” inside the RSpec.configure block of spec/spec_helper.rb …

    • Cynthia Qin

      Hi, I’ve made all the suggestions, and the added part of my Gemfile now looks like this:
      group :test, :development do
      gem ‘turn’
      gem ‘rspec-rails’
      gem ‘capybara’
      gem ‘guard-rspec’
      gem ‘ruby_gntp’
      gem ‘wdm’
      end

      But when I run ‘guard’ I kept getting this error -

      Finished in 0 seconds
      0 examples, 0 failures
      19:31:24 – ERROR – Error sending notification with gntp: No connection could be made because the target machine actively
      refused it. – connect(2)

      Can anyone help? Thanks!!

      • Steph H

        I’m having the same problem, did you find a solution?

    • http://twitter.com/lincabbey Lincoln Abbey

      Thank you, Peter. This worked for me. I was getting this error at 8:56 in Jeffrey’s tutorial:

      ———-
      $ guard
      [...]
      Failures:

      1) Tasks GET /tasks display some tasks
      Failure/Error: visit tasks_path
      NoMethodError:
      undefined method `visit’ for #
      # ./spec/requests/tasks_spec.rb:6:in `block (3 levels) in ‘
      ———-

      I did what you said, and added this one line to my spec_helper.rb file:

      ———-
      RSpec.configure do |config|
      config.include Capybara::DSL <<– ADDED THIS LINE
      ———-

      The error was gone when I reran the "guard" command.

      (I'm using Mac OS X 10.6.8, rails 3.2.11, capybara 2.0.2.)

      • http://www.facebook.com/adam.bramley1 Adam Bramley

        Thank you! Had the same problem, this fixed it instantly.

  • http://twitter.com/mulkave Abed Halawi

    By the time I am watching this great screencast many things have changed regarding gems which required a couple of small tweaks to get things to work with no issues:

    1. Replaced gem 'turn' with gem 'turn', '<0.8.3' to get spec:install to work

    2. Replaced gem 'growl_notify' with gem 'ruby_gntp' to get rid of ERROR - Error sending notification with gntp: no such file to load -- ruby_gntp

    3. Added config.include Capybara::DSL to RSpec.configure do |config| to get rid of undefined method `visit' for #

  • Trapp

    I feel like this tutorial has so much to offer, but it’s at a lightning pace! I have to keep pausing to see the code, and it really shouldn’t be that difficult – it’s not complex code or concepts, but you switch back and forth between files so fast, and have edited code input to speed up the process that it’s almost like watching a Slapchop infomercial.

    My $0.02. Less coffee, real-time code input and slow the talking pace down to about 1/2.

  • Kris

    Excellent tutorial. Thanks Jeffrey

  • ken

    why the rush? I’l look for other tutorials. I can’t keep up

  • pinkroads

    you’re wary too fast

  • pinkroads

    you’re way too fast

  • http://www.martin-brennan.com/ Martin Brennan

    This is a great tutorial on Rails for developers who may already be proficient in something else. I was getting frustrated with other tutorials that used scaffolding heavily and didn’t explain what it did, and I was really reluctant to use it because I felt like it made heaps of unnecessary code all over the place. I’m glad that I can now make my own controllers, views and models now because of this tutorial. It did take me a while to get through because I had to pause a fair bit and there were some unexpected Terminal errors that came up along the way, but I’ve come to expect that now anyway with anything even remotely to do with the terminal. Thanks Jeffrey!

  • New Guy

    I come from an extensive PHP background, but was given an opportunity to pick up some work with RoR, so I decided to dive in. I downloaded several books, and found the introduction to rails to be overwhelming every time. Sadly, it was the same here. I’m sure after I do a few more overwhelming tutorials my brain will figure it out, but I have to say, I’ve yet to find a single clear step-by-step tutorial that really explains the Rails environment well for somebody new. Will hopefully decipher exactly what it is I did over the next few days (though by and large, all your examples worked with the exception of one gem, which is much appreciated!)

  • http://www.facebook.com/Eugene.J0seph Eugene Joseph

    This is just way too fast for someone learning. You need to slow this down. Otherwise Great Job, really good tutorial!

  • http://www.facebook.com/Eugene.J0seph Eugene Joseph

    You need to have “attr_accessible :task” in task.rb , not sure how its working for you

  • travis

    Great tutorial! i’m a noob to rails and from watching this video i can already tell i’m going to love using rails in my development process. How ever i was hoping someone could help me out with this. when i try creating the model Task i get this error

    invoke active_record

    The name ‘Task’ is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.

    Any thoughts?

  • http://twitter.com/matthewpoer Matthew Poer

    This is an awesome tutorial. Hit a few system snags using Ubuntu with apt-provided ruby etc but nothing Google-ing couldn’t help me solve. I’m coming from PHP with little to no test-writing experience and this was very good intro to both Rails and TDD.

    And to the folks saying he talks to fast… press pause, do what he said, play with it for a bit, then hit play. You can’t expect to watch a recorded video like this and have the speaker sit and wait for 10 minutes every time he says to type something.

  • Tm

    you speak way too fast, no pun intended here, seriously take your time, breathe a bit, the content is great but your delivery needs a lot of work. check out the old Dan Benjamin tuts, now that guys knows how to deliver content. I’ve watched a bunch of your videos and all of them suffer form the same problems, you talk too fast… SLOW DOWN

    • fred

      Download the video and play with VLC. set the speed to 0.90 or 0.80 and you will have a relaxing slow voice :)

      • http://www.facebook.com/profile.php?id=798543901 John Moore

        haha great advice, made this so much easier to digest.

  • David

    The pace for me is fne, however, my issue is this is the “Into to Rails” however, you’re talking about several terms that you haven’t defined for us yet. This is going to make it difficult for beginners to know what you’re talking about

  • svek

    I really liked to speed of the tutorial. I hate tuts where you sit for 1h just to learn the absolut basics which could be covered in 5 minutes.

    It’s like porn. You scrub through it until you find something interesting, then wank and go to the next interesting section ;-)

  • http://www.facebook.com/people/Udvari-Tibor/1322372872 Udvari Tibor

    Really nice … most efficient tutorial I’ve seen so far on getting started with Rails

  • http://twitter.com/_gerardo Gerardo Rodriguez

    This is an awesome tutorial!!! Thanks so much! I’m a Front-Dev with experience in Back-End using PHP & Zend Framework. Sure, as others stated, I had to do some troubleshooting along the way. In my brief experience, though, this is normal. Learning how to troubleshoot and figure out any gem issues is part of the package. This led to lots of frustration initially (before this tutorial), but once I mentally got past that fact, I ended up learning so much more coming in with an open mind. Thanks for taking a TDD approach. I’d only heard of, but had never really gotten a chance to challenge my thinking in this way. It’s refreshing to see the world a bit differently. Thanks again! :D

    P.S. For all those people saying you speak too fast, I admit, this is true. That’s what the “pause” button is for. ;)

  • Rick

    I totally agree with Josh. Jeff you have a lot of knowledge but to be truthful I joined Nettuts premium and you are like this in all of your courses. A little constructive criticism my friend ssssllllloooooww down and come up for air. You know this stuff so please take into account that we are learning.

  • http://conantonakos.com/ Con Antonakos

    Is there an updated version for Rails 3.2? Or just does all this syntax hold?

  • http://twitter.com/nodemaker Sumeru Chatterjee

    Wow this was exactly I was looking for. No bullshit just pure hackery!

  • Indrajeet

    Nice..

  • ernestoguitar

    It is a really great tutorial but definatley takes time swallow, not for beginner programmers but for those who want to work with rails. Excellent tutorial, really enjoyed it!

  • http://www.facebook.com/pixel67 Tony Brown

    Wish I found this tutorial when I started. I found it to be a great tutorial, although when I tried to use a postgreSQL DB I ran into problems with ‘gem pg `0.15.1` which I couldn’t find any solutions to except to use an older version of postgreSQL. Other than that, great job Jeffery Way m/@m/

  • http://twitter.com/kangarara kangarara

    Hm. Mostly fine, but my guard isn’t ever quite happy. I keep getting:

    /Users/kangarara/.rvm/gems/ruby-2.0.0-p0/gems/minitest-4.7.1/lib/minitest/unit.rb:1020:in `block in process_args’: invalid option: -f (OptionParser::InvalidOption)

    from /Users/kangarara/.rvm/gems/ruby-2.0.0-p0/gems/minitest-4.7.1/lib/minitest/unit.rb:999:in `new’

    from /Users/kangarara/.rvm/gems/ruby-2.0.0-p0/gems/minitest-4.7.1/lib/minitest/unit.rb:999:in `process_args’

    from /Users/kangarara/.rvm/gems/ruby-2.0.0-p0/gems/minitest-4.7.1/lib/minitest/unit.rb:1049:in `_run’

    from /Users/kangarara/.rvm/gems/ruby-2.0.0-p0/gems/minitest-4.7.1/lib/minitest/unit.rb:1042:in `run’

    from /Users/kangarara/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/test/unit.rb:21:in `run’

    from /Users/kangarara/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/test/unit.rb:774:in `run’

    from /Users/kangarara/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/test/unit.rb:366:in `block (2 levels) in autorun’

    from /Users/kangarara/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/test/unit.rb:27:in `run_once’

    from /Users/kangarara/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/test/unit.rb:365:in `block in autorun’

    Google and stackoverflow have thus far failed me. Thoughts?

  • Dave

    Great tutorial! Yes it’s fast, but there’s a ton to cover, and a lot of it got in there. Viewers can (and will!) re-watch/pause to their heart’s content, so I think the speed is appropriate. I think maybe ‘introduction’ is a misnomer; you’d have to be familiar with a lot of Rails going in, but assuming you are, this is a great and possibly unique demonstration of BDD in Rails.

  • Carlos

    While the abbreviation ‘rails g’ works ‘rails generator’ is wrong. It should be ‘rails generate’

    Source : ‘rails –help’