Railings: A full featured Ruby on Rails template
Article posted by Joel Moss on 23 Sep 2009   |  

I've found myself creating a number of new Rails apps as of late, and found it very cumbersome to set each one up with my favoured list of gems and plugins. So I created my own Rails Template.

Rails templates are single ruby scripts which contain a few commands that help you setup any new Rails app in a snap. So you can specify a list of Gems to have installed and part of your environment.rb, and also install a bunch of plugins, amongst other things.

You should take a look at Pratik Naik's blog post for full details on what Rails templates can do.

So my default Rails template is called Railings, and is available now on Codaset. It is sure to grow by the day, but for now, this is what you get:

  • jQuery 1.3.2
  • Blueprint CSS Framework
  • Initializes as a Git repo and creates .gitignore
  • Creates staging environment
  • Creates application layout
  • A default database.yml, and a modified database.example.yml which is ued with the 'Wheres my database.yml dude?' rake task
  • Creates Vlad the Deployer deploy.rb config file
  • Time formats initializer
  • The following gems:
    • thoughtbot-factory_girl
    • rubyist-aasm
    • mislav-will_paginate
    • hpricot
    • RedCloth
    • emk-safe_erb
    • settingslogic
    • vlad
    • vlad-git
  • The following plugins setup as Git submodules:
    • limerick_rake
    • mile_marker
    • squirrel
    • rspec
    • rspec-rails
    • exception_notifier
    • monkey-magic
    • gravatar

So the next time you start a new rails app, run this command and you will have the world at your fingertips:

rails -m http://codaset.com/joelmoss/railings/source/master/raw/railings.rb /path/to/mynewapp

CSS Pick and Mix Classes
Article posted by Joel Moss on 16 Sep 2009   |  

I was just browsing through my tweets and came across this little gem as put forward my Nate Abele; he of CakePHP lead developer fame...

It got me thinking about how I organise my CSS files and code, and as I have been writing a lot of CSS recently when developing Codaset, it made me realise that I have developed a bit of a habit with my own CSS. So I thought I'd share it all with you.

Over the last year or so, there seems to have been an explosion of CSS frameworks. I suppose it was inevitable really, as it happened with Javascript, so why not CSS. ANd to be honest, I would say that is a good thing, and there are some decent ones out there. But my CSS framework of choice is the excellent Blueprint framework. It's a great starting point for all your CSS, and sets some good reset points. It's also very lite-weight.

Before I continue, I just want to say that I will not be telling you how to use Blueprint or indeed, how to write CSS. I use Blueprint's grid classes, but again, I won't be talking about them. This post is more about how I use a class based system for my CSS.

First, if I don't already have one, I create a css directory within my public root, the place Blueprint's three CSS base files within a sub-directory. I usually call that blueprint. (surprise, surprise). Then I create two files within my css directory called base.css and site.css.

I've used this structure for this site:

Pretty obvious so far! Now let me explain what I do with the base.css and site.css file.

base.css

Blueprint has a great set of resets or default styles, but sometimes, I want to overwrite these. I also find myself writing my own default styles, so I put all these within the base.css file. A simple rule of thumb is that only classes are allowed in the base.css file.

Since I started using Blueprint, I've started using it's default classes a lot. Classes such as .quiet and .small make it very obvious what I am doing to a particular element. So if I want told make a line of text a little smaller, I can simply wrap the text with a div or a span, and give that div or a span a class of small:

<div class="small">
  Here is some text I made a little smaller than the rest.
</div>

If I wanted it to be colored a little lighter too, then I can add another class to the div:

<div class="small quiet">
  Here is some text I made a little smaller than the rest, and it's quieter.
</div>

Both those classes and more are all ready to go as part of Blueprint. But I know also want to make this text bold. So I could either give this div an id and create a CSS rule for that new ID like this:

#myNewDiv {
  font-weight: bold;
}
<div class="small quiet" id="myNewDiv">
  Here is some text I made a little smaller than the rest, and it's quieter and now bolded.
</div>

But that's a bit daft, as I am likely to want to make other elements bold. So a new class would be better:

.bold {
  font-weight: bold;
}
<div class="small quiet bold">
  Here is some text I made a little smaller than the rest, and it's quieter and now bolded.
</div>

Now I could easily have given this div an ID instead and done away with all the classes completely. But again, that isn't reusable. Another thing I like about the above, is that is very readable and obvious what the classes are doing. It's very expressive, and even makes it very easy and fast to style, as all I need to do is assign a few classes, rather than creating any new CSS styles. It's like a pick and mix for CSS!

So I'm now finding that my HTML is full of classes, and I'm seeing less and less ID's. I only tend to use an ID to style an element if that element is more complex, or has specific needs that are not used elsewhere.

site.css

So the site.css file is therefore used for element specific styling. So any CSS styles that are defined with an ID, are placed in this file. Not much more to say about that actually.

For more about how it all fits in, check out the source and CSS of this site and of . I would love to know your thoughts and feedback on this. Comment away...


A sexy, ajax based jQuery dialog window, with a one track mind.
Article posted by Joel Moss on 19 Aug 2009   |  

So I had a need when developing the beginnings of Codaset, for a nice looking javascript modal/dialog window implementation. I wanted to be able to easily and quickly open up any link in a great looking dialog. I had no shortage of options, as there are tons and tons of jQuery lightbox scripts, or thickbox inspired plugins. But they all seem to want to be the best at absolutely everything.

All I wanted was a simple way to open up a link via ajax into a nice looking dialog window. I didn't need to show a slideshow or open up the contents of a div. And I really couldn't find one that did just that and did it well.

So like all good developers, I created one myself!

It's been in use on Codaset DialogCodaset since the private beta launched a month ago, and is running nicely. So I thought it was about time I open sourced it and released it to the unsuspecting public. So if you want a sexy, ajax based jQuery dialog window, that is extremely easy to use, does exactly what it says on the tin, then please checkout the project now on Codaset, and feel free to clone and/or fork the source.


Codaset is alive!
Article posted by Joel Moss on 19 Jul 2009   |  

Yes I know it's been quite around here, and yes I know I've only written five of the 10 reasons why Ruby is better than PHP, but I've been really, really busy! And now I have something to show for my busy-ness. Codaset went live about 30 minutes ago, and is now up at http://Codaset.com. You can only get an account if you apply for the beta, but you can still do loads more on the site without one.

Here's a reprint of the official blog post from the new Codaset Blog...

Phew!! I did it! Codaset beta just went live about 10 minutes ago, and if you are reading this, then you are already using the beta.

What started as a genuine need and a desire to create a software development management platform that is actually useful, has turned into what you see right here. Codaset is and will be a tool that I use personally, simply because I am always having to use several different tools or services, to achieve what I need and want. Tools and services such as Github, Trac and Campfire all have pride of place in my browsers bookmarks. They are excellent at what they do, but of course they only do certain things. I want a tool that will gather everything that is good about these three services (and others), and present them to me in an easy, but very useful way.

Right now, Codaset is beta software, which means nothing is complete, and there maybe (and probably will be) bugs. So any bugs you do find should be reported to me as soon as you see them. And what better place to do that, than Codaset itself! Create a ticket for any bugs you find, and any features, or enhancements that you think would rock yours - or anyone elses - world.

There are still so many, many more things that will be added during the beta, and I will be blogging about them all right here. You can also keep up to date with Codaset via Twitter.

Even though this is a beta, parts of the site are open to non beta and anonymous users. But you can only create an account, create and fork projects if you have applied for the beta, and have since been approved. So all of you who applied to the beta prior to us going live today, will be receiving an email within the next few days. This will contain instructions on how you can get your account created, and your first project started on Codaset.

Everyone else can still get a beta account, by applying from the homepage at Codaset.com, and I will try my best to get you an account.

Beta testers will receive full and unrestricted access to the entire site during the beta. Once the beta ends (don't ask, as I have no idea when that might be) you will continue to receive access to those same features at no cost. However, I cannot guarantee that any new features introduced after the beta ends, will be provided to you at no cost. Hey, but I will definately try.

That's all I wanna say for now, because I'm completely knackered. So I'm off to play a little xbox. Oh yeah, and I suppose it might be a good idea to eat ;)

Thank you to all of you, and please play with it all! Enjoy!



Recent Comments