I'm on a twitter bootstrap binge at the moment, it fills my soul with glee to start a new project with a base template that looks better than the usual dog's breakfast. Anyway, there are days when you just need a piece of code to blast in to your templates so that you can get on with your work. This is one of those and slapping the tremendous bootstrap success, warning and info messages into our normal flash message stylings is just what the doctor ordered.
Here then, for your delectation, a small snippet of code to pop into your application layout in place of your usual flash message code that will style things up the bootstrap way. If you prefer, pull this out into a helper.....if you think that's the rails way. Personally, for small projects, I don't bother.
For fun, I thought I would start a new Ruby on Rails project and use MiniTest instead of Test::Unit. Why? Well MiniTest is Ruby 1.9s testing framework dejour, and I suspect we will see more and more new projects adopt it. It has a built in mocking framework and RSpec like contextual syntax. You can probably get away with fewer gems in your Gemfile because of that. Getting started is always the hardest part - let's jump in with a new rails project rails new tddforme --skip-test-unit Standard stuff. MiniTest sits nicely next to Test::Unit, so you can leave it in if you prefer. I've left it out just to keep things neat and tidy for now. Now we update the old Gemfile: group :development, :test do gem "minitest" end and of course, bundle it all up.....from the command line: $ bundle Note that if you start experiencing strange errors when we get in to the generators later on, make sure you read about rails not finding a JavaScript runtime . Fire up...
Comments
Post a Comment