August 2011 - Posts

About a month ago I started diving into the world of Rails again. As I said in that blog post, Rails has always had much thought leadership and has always been a hip way to develop.

Now 2 of the main new technologies that where discussed in that blog post have made it into the .NET world in a very polished way.

Mindscape, the folks who made the wonderful LightSpeed ORM, have made the free Web Workbench, which supports LESS, SASS and CoffeeScript. I wrote a little bit about SASS and CoffeeScript in my previous post. LESS is the main competition for SASS, a comparison between these two in terms of syntax can be found here. One of the main differences is that LESS can also be interpreted on the client side within the browser with JavaScript.

Web Workbench features:

  • Code highlighting for all of these technologies.
  • Code generation for SASS and CoffeeScript which just works by saving the files your editing.
  • Intellisense for SASS and LESS.

This is a pretty clean way of being able to use these technologies in your next .NET web project.

Of course there are other ways, but that might be a story for a new blog post.

Mindscape also created a nice making of blog post for Web Workbench for which they used: F#, IronRuby, Jurassic and bits of Node.JS. This sounds like a pretty hard-to-cook recipe but it looks like they pulled it off.

 

As a bonus, here is a debate about LESS and SASS

Let the fun begin

Ok diving into Rails after not having touched it in a while feels a bit painful to be honest.

Getting Started

Using the guide on: http://rubyonrails.org/download I got off to a good start.

Picking the latest version of Ruby + the rails 3.1 RC.
Then the first problem seems to be going after the database.

Sqlite3.dll needs to be downloaded and put into the rubypath\bin directory.

Easy step to do just head over to sqlite.org/download to get that.

Now I tried getting MySql to work with this rails version, but after trying to use a specific (older) version of the mysql2 gem and using some compiling options I still didn’t get it to work.

This feels rather painful

Scaffolding

The way Rails wants me to work is a little different from what I’m used to doing.

What I’m used to doing:

Model database (MySQL, MSSQL … )
Generate scaffold

Make the actual screens.

Rails does it differently.

I want my views generated from my model, this can be done in Rails by using the command line not through using files in which you set up the database.

The Rails way –> Use Command line –> create migration + controller + view

Not:

Create Model, either in database of code –> generate views

Now it can be achieved to get the views without regenerating by using something like nifty scaffolds, but this won’t give you the starting point in terms of forms etc which you can then edit.

To be Continued …

I’m sure there will be more fun in trying the Rails way again and that there will be some things which will be harder because I’m trying an RC release and not a safe stable version.