Firsts steps with Ruby On Rails

As I mentioned before, I planned to rewrite recordShops in Ruby on Rails. Actually, more that rewriting this particular application, I’ll try to write a generic “locate and review” tool, with usual tagging and Google Maps stuff.

So, let’s talk about RoR. I’ve already looked at it before, but started seriously to play with it today. And that’s really cool!

Reading Four Days in Rails and with only a few lines of code, I got an object oriented item/reviews model with the appropriate editing forms.

  • You want each item to have a name ? Just add validates_presence of :name in your item model and the form won’t validate if name is empty.
  • Reviews need to be at least 20 chars ? Add validates_length_of :review, :minimum=>20
  • And you want a dropdown country list ? Type <%= country_select 'item', 'country' %> in your form.

Nice isn’t it ?

Then, I looked for an authentication plugin and installed auth_manager. This plugin includes e-mail validation of accounts, password reminder, different user levels, protected webpages …

Next step was tagging. Acts_as_taggable seems to be the way to add tag features to items.

I still need to integrate Google Maps (Cartographer plugin uses v1 API so I’ll have to look at its code before making it run with the new one), but at the moment, I’m really impressed with RoR features to easilly write “basic” online apps.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s