Episode 2 - Static pages

Episode-2-static-pages

Click on image above for a preview

Released: Aug 22, 2009, Running time: 19 min

In this episode:

Adding static pages. We write the Cucumber feature, spec, then add the controller code and finally views.

Tags: haml, cucumber, rspec, controller

FREEWatch episode

Downloads

Item Size
Quicktime (MP4) 51.91 MB
iPhone 24.84 MB
  • Share

In every Rails project that goes on for a while, at some point you want to add some static pages. If you want to add an About page, Terms of Service or your pricing plans, chances are there is not much to them than some template code.

We add static pages support to Brandizzle from the beginning, to get it out of the way. It also helps us with writing our first feature.

In this episode you can see the following work cycle:

  1. Write feature
  2. Watch feature fail
  3. Write spec
  4. Watch spec fail
  5. Make spec pass
  6. Make feature pass
  7. Refactor
  8. Make spec pass
  9. Make feature pass

Stay tuned for episode 3 where we start adding some useful functionality to the project.

UPDATE 2009-10-22 (thanks takaaki). Some notes about making things work:

Install the gems below

  • sudo gem install cucumber
  • sudo gem install rspec
  • sudo gem install rspec-rails
  • sudo gem install rcov
  • sudo gem install haml

Also read the first several paragraphs at http://wiki.github.com/aslakhellesoy/cucumber/autotest-integration . You need to turn on “AUTOFEATURE” so that “autospec” commands run both features and specs.

Screenshots

  • Vlcsnap-2009-08-22-07h19m45s3
  • Vlcsnap-2009-08-22-07h20m09s243
  • Vlcsnap-2009-08-22-07h23m51s161
  • Vlcsnap-2009-08-22-07h24m26s255
  • Vlcsnap-2009-08-22-07h24m31s48
  • Vlcsnap-2009-08-22-07h27m10s87
  • Vlcsnap-2009-08-22-07h29m52s179
  • Vlcsnap-2009-08-22-07h31m04s131
  • Vlcsnap-2009-08-22-07h50m03s249
  • Vlcsnap-2009-08-22-07h53m11s91
  • Vlcsnap-2009-08-22-07h53m58s43

3 comments

Thanks for the great screencast. I followed you guys and took notes of what I think may be helpful to others.

Install the gems below

  • sudo gem install cucumber
  • sudo gem install rspec
  • sudo gem install rspec-rails
  • sudo gem install rcov
  • sudo gem install haml

Also read the first several paragraphs at http://wiki.github.com/aslakhellesoy/cucumber/autotest-integration . You need to turn on “AUTOFEATURE” so that “autospec” commands run both features and specs.

In reply to takaaki

Thanks for the great screencast. I followed you guys and took notes of what I think may be helpful to others.

Install the gems below

  • sudo gem install cucumber
  • sudo gem install rspec
  • sudo gem install rspec-rails
  • sudo gem install rcov
  • sudo gem install haml

Also read the first several paragraphs at http://wiki.github.com/aslakhellesoy/cucumber/autotest-integration . You need to turn on “AUTOFEATURE” so that “autospec” commands run both features and specs.

Thank you for the notes. I have updated the show notes with them.

Thanks for the Brandizzle series. Lots of things to learn.

As a note, when rendering the 404, I think it is simpler to use:

     render :file   => File.join(RAILS_ROOT, 'public', '404.html'),
             :layout => false,
             :status => 404 and return

as it is not required anymore to create the show.html.haml which is somehow redundant.

Commenting is disabled.