Setting up Rails 3.1 with RVM

Just want to do a quick how to post for those out there wanting to setup Rails 3.1 on RVM and not effect their existing rails 3.0.x setup. To do this we take advantage of RVMs gemsets.

First thing to do is make sure you have the latest version of RVM


$ rvm get latest

or rvm update, depending on the version of rvm you have installed.

next thing to do is create a new gemset for Rails 3.1


$ rvm gemset create rails31

then switch to it


$ rvm gemset use rails31

and finally install rails 3.1


$ gem install rails

And there we go! nice and easy!

If you want to switch back to your rails 3.0.x gemset and haven’t setup a gemset for it, it should still be setup in the default ‘global’ gemset which you may need to reinstall rails 3.0.x into and do all your bundle installs.

So now what?

  • Start a new project and have a look around, you’ll notice that the biggest difference is the assets folder in the app directory which holds all your sass and coffee script files.
  • Take a look at the Sass and Coffee Script documentation to get started with them
  • Keep an eye on Railscasts for some more in-depth rails 3.1 focussed episodes

The Sass way

Yesterday I started using Sass/SCSS to compile my style sheets inĀ preparationĀ for Rails 3.1 which is due out August 30th (today). It’s safe to say it’ll be my default way of writing CSS when possible from now on. The code is just so elegant and really is the way CSS should be. Nesting and re-using code is made simple and logical as I’ll illustrate later on. Continue reading

Pods CMS Function

In pretty much every WordPress site I put together, I use Pods CMS, a framework that lets you build and display your own content types. Because I use pods so much, I got sick of writing the same code over and over (just a simple do while to pull all the data out of a pod), so I turned it into a function that you can drop into your functions.php and use form anywhere.

It takes 3 arguments at the moment, the first is the name of the pod as a string, the second is the fields you want extracted as a simple array, and the third is the the order you wish to display your results which by default is ‘name’.

You use the function by calling it into a variable eg:


    //set fields
    $fields = array('name','image.guid');
    //call function
    $gallery = get_the_pod('gallery',$fields, 'name DESC');

This has now stored the results from our pod, into a variable which we just need to loop over to get our data:


    foreach($gallery as $item){
        echo $item['name'];
     }

And we’re all done! If you’re like me and use pods a lot, then this will come in very handy. The …

The art of ARYZ

For most people, artist or not, graffiti is frowned upon. Mainly because it involves defacing property with sometimes distasteful imagery (usually gross tags or pointless scribble). But not ARYZ, every wall he touches, becomes an amazing work of art.

Gamifcation: Making fun of the web.

Yes, it’s a word!

Gamification is one of the newest and I believe one of the biggest movements in the creative world today. It is the concept that you can apply game mechanics (elements that make games fun, engaging and in some cases competative) to things that aren’t typically considered a game, or even fun! From work, to health, to socialising, to cooking, to just about anything! In essence, it’s about fun and the enjoyment of sharing the game with your friends.

So all this is well and good, but what does it have to do with you? Have you ever bought a shirt and then scanned your fly buys card? Yes? Then you are collecting points to spend on something later, you are receiving a reward for your actions.

Taking this one step further, Nike, a few years ago, introduced a device that was embeded in it’s shoes and communicated with an iPod to record data that was generated as you went for a run. This was then stored and kept as a sort of Scoreboard that was used to motivate the user to keep on running and improve their “score”. Since then, they have added a whole social layer to the program, one that lets you share your run online via popular social networking sites. By now this should be sounding …