Simply on Rails - Part 3: LiteController

Posted by h3rald Sun, 22 Jul 2007 12:03:00 GMT

Enough with concepts, ideas and diagrams: it’s time to start coding something. Everyone knows what’s the first step when creating a Rails applications, but anyhow, here it is:

rails italysimply

Then I create a new development database, load it up with the schema I previously prepared and modify the config/database.yml to be able to connect to it. Nothing new here. I actually had to modify the schema a little bit:

  • I changed all the names for the foreign keys to something more evocative than “has_many” or “has_one”
  • I added a level column to the states, availabilities and conditions table
  • I removed the description column from the categories table

Great, but… hang on: now some of the database tables look awfully similar with each other:

  • statuses
  • states
  • roles
  • types
  • tags
  • conditions
  • availabilities
  • categories

They all have a name column, some of them have a name column as well, they’ll hold only a relative small number of records which will hardly ever be deleted. In fact, I was tempted to use Enums for some of those things… Anyhow, I’ll still have to add and modify data in those tables, so it looks like I kinda need to create 8 controllers, 8 models and about four views for each one of them. No way. Fair enough for the controllers and models, but I’m not going to create 32 views which all look exactly the same. Rails should be smarter than that!

Read more...

Posted in  | Tags  | 2 comments | no trackbacks

An Interview with the creator of the Akelos Framework

Posted by h3rald Thu, 19 Jul 2007 11:02:00 GMT

I already covered the Akelos PHP framework in the past, but for those who don’t know it, Akelos seems to be one of the few Rails-inspired PHP frameworks still worth mentioning, besides CakePHP and Symphony of course.

I recently has a look at their recently-relaunched community website and I noticed this phrase:

“Being port of Ruby on Rails to PHP Akelos is also optimized for programmer happiness and sustainable productivity”

Bermi Ferrer, Akelos creator, openly admits the framework is a port of Ruby on Rails to PHP, an attempt to help “Ruby on Rails developers who need to code in PHP, among others. Of course Akelos is not Rails, simply because Ruby is (thank God for that!) not PHP, however I decided to find out more, and I asked Bermi a few questions, which he promptly answered.

Read more...

Posted in  | Tags , , ,  | no comments | no trackbacks

Simply on Rails - Part 2: Database Design

Posted by h3rald Sat, 14 Jul 2007 17:27:00 GMT

This week I attended a course for work on how to Implement Databases with Microsoft SQL Server 2005. An interesting course indeed, which made me realize how feature-rich Bill’s product is, compared to the Open Source alternatives like MySQL. It also made me realize how nice it is to implement database-related logic (read: Models) using a proper programming language rather than using triggers, stored procedures, functions and other goodies offered by Transact-SQL.

It’s all a matter of taste and of necessities: using MS SQL Server for one of my website is simply not going to happen anytime soon, and I’m more than happy to have a database which can be used just as a database and a programming language (Ruby, in this case) which can do wonders, rather than a procedural-only surrogate.

Anyhow, back to our weekly series. After creating a concept map, it’s time of get real and try to figure out a database architecture.

Read more...

Posted in  | Tags ,  | no comments | no trackbacks

Rails to Italy 2007

Posted by h3rald Sat, 07 Jul 2007 19:15:00 GMT

So it looks like there will be a “Rails conference in Italy”, after all. In Pisa as well, and that’s maybe even less than 2 hours drive from where I live (Genoa)!

Sounds cool!

Well, the entrance fee put me off a bit, I daresay (€89 if you book before August 1st, more otherwise), but it would be great to go there. They are actually looking for speakers too, pity that at the moment I don’t have anything prepared, but who knows… There’s free entrance (and beer) for speakers, apparently, which it wouldn’t be bad, but unfortunately my girlfriend would have to pay though, of course.

We’ll see what happens, for now I’m just going to promote the thing on my site (see the banner on the side).

Posted in  | Tags ,  | no comments | no trackbacks

Simply on Rails - Part 1: Concepts and Bubbles

Posted by h3rald Sat, 07 Jul 2007 13:43:00 GMT

The first thing I do when I start developing a new application is write down some ideas.

Pen and paper normally do the job, but nowadays there are some valid online and offline applications which work as good if not (probably) better.

I’ve never been a fan of Mind Mapping. I’ve been to a seminar on problem solving and creativity and they were showing how mind mapping can unleash your creativity, but it didn’t really work for me. I found the concept-idea-concept-idea sequences a bit too restrictive for my liking.

So I decided to try something different: bubbles! Bubbl.us is an interesting online flash application which lets you create bubbles. You can create bubbles and relationships between them, change their color, their dimensions etc. And above all it’s absolutely fun to use.

Read more...

Posted in  | Tags , ,  | no comments | no trackbacks