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
  • Rich Holt

    Just what I was looking for. Thanks!

  • http://www.jeffrey-way.com Jeffrey Way
    Author

    I’m knee deep learning Rails as well, so definitely let me know if you have any advice, everyone. :)

    • http://www.cnnr.me Connor Montgomery

      Great video, Jeffrey! Thanks gain! I’d like to point out the “Rails 3 in Action” book – it’s been really great helping me get started with rails, and I highly recommend it to anyone else who’d like to get started.

  • bc

    Great! Great! Great! Thank you! :)

  • Felix

    OMG MAN JUST WHAT I NEEDEDD!!

  • Ian

    I liked the webcast a lot, but I was wondering if you could elaborate on why rspec is used more than test unit? Also out of curiosity, is that theme for Sublime 2 compatible with Textmate?

    • sirfilip

      Nice presentation.
      There is a awesome plugin for vim by tim pope called vim-rails thats what i am using.
      Try it out you wont be sorry :) .

      • sirfilip

        The way you write changes the way you think.
        Although rspec does the same thing that TestUnit does when you are writing specs you are more focused on the requirment instead of implementation (which is planted in the back of your brain when you write unit tests using TestUnit).

  • http://blog.lastrose.com LastRose

    for those with windows who want to run rails, look at http://railsinstaller.org/

  • Tony

    OMG – definitely NOT what I needed.
    Not for beginners

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      It depends on your skill level. If you’re really new to the command line, git, and the MVC pattern, you might steer clear of Rails for a while. There’s definitely some prerequisites before you can even get started digging into RoR.

      • http://pixeldesignpress.com Friday

        Great incite into Ruby on Rail

      • http://jdfwarrior.tumblr.com David Ferguson

        Jeff, dude, I am familiar with MVC and command line, but it was still a little difficult to me. Not that the topic is, I think it was more like an information overload to me because I’ve never really messed with Rails at all, and it seemed like you were talking/moving pretty fast. I would have liked this a lot more if it had started completely from scratch, Rails n00b style, slowed down a bit, and taught over a series instead of cramming a lot into one video.

      • http://tosbourn.com Toby Osbourn

        @David Ferguson – With all due respect, is that not what the pause button is for? I think there were plenty of places in the video that you could pause, do a bit of reading around the subject then jump back in.

      • http://www.jeffrey-way.com Jeffrey Way
        Author

        Yeah, it’s really not a complete Rails newb tutorial. It’s for people who have already gone through a beginner’s screencast or tutorial. There is so much to cover, so I had to move a bit more quickly than usual.

        If the Rails tuts we’ve been posting gain some traction, I’ll chart out a full series.

      • http://www.greenanvil.com David Smith

        Great flyover of some basic RoR structures, tools and development flow! It’s really interesting how ‘made for web apps’ it seems compared to how ‘genericly useful’ most other common web dev languanges feel.

        The only constructive criticism I could proffer in reference to ‘information overload’ is that it felt like every pause between every sentence was edited out or severely truncated.

        I didn’t have difficulty following, but the lack of pauses -did- create a ‘rushed’ feel. Of course, there may have been submission guidelines and time limits that had to be adhered to, so take it for what it’s worth.

        In any event, keep up the great work and thanks for taking the time to put this together! I’ve been very curious about the technology and this pointed the way towards some new things to investigate. Very cool stuff and I’d say a great first look at RoR! Thanks again!

      • http://twitter.com/garbaczd david g

        It’s really odd how people have gained an interest in Rails lately. I know a lot of people who have started to dig into it, including myself. I think some Rails tuts would be awesome! I’d definitely be on board.

  • ibura

    jeff you are THE MAN. thank a lot.

  • http://vavia.in Ravindra

    Hey, Jeffrey tutorial was just awesome. It would be great if you can do some lengthy Premium/Marketplace Rails tutorials.

  • http://www.stanmx.com Stan

    Really nice tut, i like all the process with the test, thanks to made it.

  • http://tosbourn.com Toby Osbourn

    Thanks a lot for this – one of the more informative screencasts I have watched.

    It was probably out of the scope of this tutorial but a lot of the steps near the end looked like they maybe could have been turned into functions to be called again? You know to tidy up the test file a bit.

    Would this generally be best practice or is the repetition better for clarity in your opinion?

  • http://blog.zabiello.com hipertracker

    @David, check out that one http://railsforzombies.org/. It’s for total newbies.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      I loved Rails for Zombies, but don’t think it’s for newbs either. It’s essentially an ActiveRecord course. Fantastic — but it doesn’t teach the complete picture.

  • Ivo Trompert

    Nice tutorial. Why don’t you use Cucumber for testing. I think it’s more user friendly.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      I must admit, I have a bit of trouble with Cucumber. I like the current system I have setup.

      • Alexander Tipugin

        I suggest factory_girl for “dumb” content.

  • http://www.mediazoom.ca Nelson

    Hey Jeffrey, great tutorial! I would like to know your method for self study in regards to learning new languages. I’d love to know your method for “proper” learning.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Pick something, and then obsess over it for the next few months — every day.

      • http://ahermosilla.com Andres Hermosilla

        Truth!

      • http://www.geektopia.me Shaun Dunne

        I pretty much do the same thing. I’m about halfway through a book called 7 languages in 7 weeks – great book BTW for anyone who wants to learn – and it has me pretty much obsessed with programatically learning programming languages. Not perfected yet, but will get there.

  • http://www.pheromone.ca Laurent

    REALLY GOOD JOB

  • Ian Rock

    A bit over my head also as I’m just starting to learn Ruby / Rails, so I look forward to revisiting this in the future as I do like your tuts. :)
    Does anyone have any suggestions or opinions on a WAMP equivalent for Ruby / Rails – or is it a case of installing the individual parts. I’m open to switching OS.

    Thanks in advance!

    • Alexander Tipugin

      I use RailsInstaller, when on Windows.

  • http://twitter.com/tipugin Alexander Tipugin

    So much buzz around tdd/bdd approach, but i really dont see any benefits for myself. Writing tests which are often 2-3 times bigger, than code itself.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      The idea is that you’ll spend more time manually testing this stuff over and over. This way, you only have to write a test once.

    • Ian Rock

      Thanks for that, I’ll explore RailsInstaller in more depth!

      Getting a web developer setup for Ruby / Rails has left me going round in circles.

  • Adem

    Hey Jeffrey, may I ask you for how long you are messing with Rails now? Just curious about how steep the learning curve is. :)

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      A handful of months. I have very much to learn. :)

  • rege

    Hi,

    Jeffrey I think this is one of your the best screencasts ;)

    I want more screencasts about rspec and TDD !!!

    Greetings

    When next one about Rails expecialy rspec :P ??

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Thanks. I moved pretty fast — but needed to keep it under the +1 hours mark. Maybe I’ll arrange/commission “Rails from Scratch” and “RSpec from Scratch.”

  • Ian Rock

    Jeffrey, I think the thing most needed is a guide on how to take a static web guy from html / css into the Ruby / Rails world.
    It’s a cinch in PHP. Some time ago I followed your tuts on In the Woods – Diving Into PHP. I got to the PHP includes, mysql blogging part and thought “Wow”, “this is useful stuff!”.

    It almost seems that folks need to learn another programming language and get their development area setup, before they even think about developing in Ruby / Rails and transferring the skills and concepts. Which is a shame because Ruby is such a “clean” language to learn from the start.

  • http://jaymiejones.com Jaymie Jones

    Fantastic screencast Jeffrey! I didn’t think it was too fast. But it was great seeing a real world test driven development scenario which puts everything into context. Look forward to some more. Maybe some authentication next?

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Sure. I can arrange that!

  • Chris Abrams

    If you do authentication, I’d like to ask for Devise/Omniauth to be considered.

  • Daniel Gottschalck

    Hi Jeffrey!

    Very good tutorial.

    All though you might want to switch out the for loop in your view, with the Rails style:
    @tasks.each do |task| ? :)

    Regards

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Why? The for-in style works fine there. :)

      • Daniel Gottschalck

        Why?

        Because why use a Ruby loop in a Rails view file? :)

        There is a very small difference in those 2 loop-approaches.

        But why do it that way when every other Ruby on Rails book does the “@stuff.each do |stuff| way? :)

        It sure well works fine, but it can be confusing for some, when they normally see the other approach.

        The “@stuff.each do |stuff|” is also generated by the scaffold engine.

      • http://www.jeffrey-way.com Jeffrey Way
        Author

        I’ve seen plenty of Rails developers use simple for-in loops in a view. Don’t think it makes too much difference either way.

  • Justin Christensen

    Hey Jeff :)

    Thank you very much for the screen cast. This fits perfectly with the speed and way I like to learn!

    I rarely post but I’ve been reading NETTUTS for quite some time now and I really appreciate the time and effort you guys put into providing quality stuff like this.

    Thanks again!

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Thank you, Justin!

  • Stuart Clove

    I cannot describe in words how phenomenal this was. I have looked at many books and screencasts for Rails and this is by far the best intro I have ever seen. I really hope to see more videos on Rails from you in the future. Bless you forever.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      I’m so glad to hear that.

  • Stuart Clove

    Sorry for the double comment and the noobish unrelated question but could you tell me what theme you are using for Sublime and where you got it? It looks glorious. Thanks man.

  • PhillipKregg

    A tip for Windows 7 developers: if you are having issues running ‘rails g’ after bundling your gems, include gem ‘win32console’ in your gemfile. You may also need to set the ‘turn’ gem to a specific version: gem ‘turn’, ‘< 0.8.3'. The most recent version requires the minitest gem as a dependency and my Windows system didn't like that.

  • sirfilip

    Nice presentation.
    There is a awesome plugin for vim by tim pope called vim-rails thats what i am using.
    Try it out you wont be sorry :) .

    Sorry about this i mess it up a little. Forgot that i was suppose to reply on the question Why Rspec instead TestUnit.

  • amul patel

    Wow, I been learning rails off and on for a couple of years.. and I can say the TDD is such a pain in the ass for newbies. Getting something up and going and having FUN – is so important. Then TDD comes in and kills the buzz.

    Your screencast is so far the best presentation I seen that I could actually SIT THROUGH.
    Please keep em coming.

    - enhancing rails apps with jquery would be really cool.
    - social authentication (facebook, twitter)

    Amul

  • http://rorywalker.com Rory

    Jeff basically taught me PHP and jQuery.

    Looking forward to this, any download links?

  • Paul

    Jeffery,

    Nice tut, just a quick question regarding setup? which version of rails are you using?

    I only ask as with rails 3.1 when I try the ‘find(‘#task_#{@task.id}’ in the delete post test I get an error which is ‘Nokogiri::CSS::SyntaxError’. Any thoughts on this?

    • http://twitter.com/halldennis Dennis

      Hi Paul,

      if you or others are still looking for an answer on this one. Replacing the single quotes with double quotes like this (“#task_#{@task.id}”) should do the trick. If you watch close enough you can see that this error also appears in the video. The fix may have gotten lost in post edit.

      Have a nice day, Dennis

      • http://rorywalker.com Rory

        Thanks Dennis

  • http://Www.theeightyfive.com James

    I’m gonna need to watch this a few more times. That said, this tutorial just blew my mind!

  • gavin

    This rocks…sincerely.

  • http://blazeeboy.blogspot.com blazeeboy

    i nearly got a mental damage due to your speed at coding, nice tutorial but please next time make it slower

  • niyazi

    hello from Turkey
    we couldn’t see your video. becouse of regulations of internet here. but i couldn’t understand that this is your original website and you put this video yourself. why our authorities blocked this ? , it is stupid . can you give us another link for this video ?

  • http://japh.com.au/ Japh

    This video was brilliant, Jeffrey!

    I’m just getting into Ruby on Rails myself, and really wanting to use TDD too. I found that I could totally follow along with your pace, and it was great to see TDD in action in a real-world scenario to get a grip on how to approach it myself.

    Thanks again! :)

  • Glenn

    -bash: guard: command not found

    But guard (0.8.4) and guard-rspec (0.5.0) are in use!

    • http://twitter.com/halldennis Dennis

      Hi Glenn,

      had the same problem today. After restarting the terminal, guard was available.

      Have a nice day, Dennis

    • http://rymai.me Rémy Coutable

      You should probably run guard with bundle exec guard.

      • http://www.rockhopperdigital.com Benjamin Zalasky

        Thanks, Rémy! That worked for me…

  • Tom

    Nice tutorial.

    Another great tutorial for rails taking you from beginning to a fully functional application is: Michael Hartl’ “Ruby on Rails Tutorial. You have to pay but it is worth it.

    Anyone have any ideas or know of a tutorial that explains how to use postgresql with rails.

    Thanks.

    Tom.

    • http://michele-garoche.org/ Michèle Garoche

      Just create the project with:

      rails new tasks -d postgresql -T

      Do not forget to change the user and password in database.yaml to conform to your postgresql settings, as by default rails puts for user the name of the project.

      As for installing postgresql server, see on the postgresql site, it is explained for various systems.

  • David

    Thanks for making a real world screencast that pulls it altogether.

    Also, thanks moving at a good a speed and packing that vid full of info instead of fluff. This was definitely one of the few screencasts that actually conveys information more efficiently than just reading plain text.

    +1

  • Giedrius

    Nice screencast. Learned some stuff about capybara! :)

  • Oscar

    “UNREGISTERED”… Shame on you XD (just kidding, same here :P )

    This is an awesome introduction to real Rails development. I do really like TDD, GIT and those tools and patterns you showed.

    I can’t imagine a real project without them. Keep the good work!!

  • http://rorywalker.com Rory

    Hey, anyone else getting a “sorry, we are unable to play this video” message.

  • Tharnid

    Great tut Jeffrey!!! I am having weird issues with Rails 3.1.x for some reason. I was just getting the hang off 3.0.x. I will say that I had to run:

    touch guardfile

    before I was able to run guard init rspec. I agree that a couple of testing screencasts would be nice :-)

  • Jimmy

    Great tutorial!

    I follow the railstutorial.org which I assume you’ve done as well.
    I manage to get db working as in your example, but now with an app without a current db I get the “we’re sorry” on all pages.

    Any ideas?

  • http://ollieread.com Ollie Read

    Hi Guys,

    As it stands, I’m only just under 5 minutes into this video but I encountered two issues I’m going to share for any other newcomers.

    Firstly, I updated my OS X Ruby installing moments before starting this tutorial, and unfortunately the gem turn was updated the day this tutorial was released, so if like me you installed after the 10th, you’ll have turn 0.8.3 which unfortunately has an undeclared dependency for MiniTest which causes issues because of the -T directive. To remedy this I simply changed the line to “gem ‘turn’,'<0.8.3'" which fixed the issues.

    My second issue was with guard, for some reason "guard init tasks" wouldn't create the guard file, had I known what guard did, I'd have used touch, but instead I ran "guard init" before hand.

    Hope this helps others.

  • MaerF0x0

    I get an error with `guard init rspec`

    [user]@[machine]:~/railsApps/tasks$ guard init rspec
    ~/.rvm/gems/ruby-1.9.3-rc1/gems/guard-0.8.7/lib/guard/guard.rb:62:in `read’: No such file or directory – Guardfile (Errno::ENOENT)
    from ~/.rvm/gems/ruby-1.9.3-rc1/gems/guard-0.8.7/lib/guard/guard.rb:62:in `init’
    from ~/.rvm/gems/ruby-1.9.3-rc1/gems/guard-0.8.7/lib/guard.rb:34:in `initialize_template’
    from ~/.rvm/gems/ruby-1.9.3-rc1/gems/guard-0.8.7/lib/guard/cli.rb:103:in `init’
    from ~/.rvm/gems/ruby-1.9.3-rc1/gems/thor-0.14.6/lib/thor/task.rb:22:in `run’
    from ~/.rvm/gems/ruby-1.9.3-rc1/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task’
    from ~/.rvm/gems/ruby-1.9.3-rc1/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch’
    from ~/.rvm/gems/ruby-1.9.3-rc1/gems/thor-0.14.6/lib/thor/base.rb:389:in `start’
    from ~/.rvm/gems/ruby-1.9.3-rc1/gems/guard-0.8.7/bin/guard:6:in `’
    from ~/.rvm/gems/ruby-1.9.3-rc1/bin/guard:19:in `load’
    from ~/.rvm/gems/ruby-1.9.3-rc1/bin/guard:19:in `’

    • MaerF0x0

      Solved my own issue! see how it says “No Such file or directory – Guardfile …” that means I am missing the file “Guardfile” …(duh) .

      simply had to do this inside the /tasks/ directory
      `touch Guardfile`

  • zaw

    WOW That was perfect example of showing what exactly I need to learn!

    As for php dev they would complain about new syntax and command line, I don’t mind that if you get on to some practices, you will get use to it.

    Definitely want to learn more RnR from nettuts, please Jeff. and thanks :)

  • http://www.g-p.si Pjero

    Great approach. Finally something new, not just a copy paste of the blog in 30 minutes tutorial.

  • Steve

    anyone else having this issue?

    Guard::RSpec is running, with RSpec 2!
    Running all specs
    /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
    /usr/local/lib/ruby/1.9.1/test/unit/testcase.rb:9:in `’: uninitialized constant Test::Unit::TestCase::Assertions (NameError)

    • http://www.estebanf.com Esteban

      Yes,

      Add

      require ‘test/unit’

      at the top of spec/spec_helper.rb

      • http://rymai.me Rémy Coutable

        I think you should just remove gem ‘turn’ from your Gemfile instead of requiring test-unit in your RSpec config file!

      • John Calistro

        I just removed the gem turn, like the Rémy told, and works like a charm.
        Thanks.

  • http://www.devasto.org video youtube

    amazing! thanks a lot