REST ON RAILS
March 16, 2006 at 9:15 pm | In REST on Rails, Ruby on Rails, XML, gizmoojo, rails engines | Leave a CommentWow.. Its been a while since I last wrote something for the blog. And that is because I am coding away for the past few nights (I am still working full time as a software engineer and really after a long day at work, you can be sure that you would just want to sit back and relax). But I really think that what I am trying to build is going to be pretty exciting, well at least for me. So that’s what motivating me right now. And of course, the support from my wife plays a huge part too!
Rails is just a well thought out framework, really, if you can put aside the thought of the magic that it is doing in the background. But like what it is meant to be, it helps Web developers with Agile and Rapid prototyping or developing. The reason why I felt that way is my smooth it was for me to just type a few command lines and then edit a few controller files, and BAM! Gizmoojo now has well working User’s and Role Management module. I am refering to the UserEngine from Rails-Engine! Honestly, it really surprised me on how smooth the setup went. You see, I am a Linux fan and have been using different distros, since the days of RedHat 6. And believe me, during the days of RedHat 6, installing and having Redhat worked right out of initial setup with your PC hardware is not magically at all
.
Now if you are wondering why this post is titled “REST ON RAILS”, here’s why. I was writing one of the service app for Gizmoojo and this service bascially needs to interface with a third party web service provider, eg “Google maps, Flickr, and many others”. And I need something to parse and handle the XML response from the web service and you know what, without any work, well not really without any work, you had to type a couple of lines but that was it!
require ‘rexml/document’
include REXML
You see, Rails has the REXML module and that is included with the Rails installation. So by typing these 2 lines in your controller files, you basically have an easy way of generating and consuming XML for the controller.
*Good reference to using REXML with Rails and with the same title as this post too!
Rails Engines vs Rails Generators
February 24, 2006 at 8:57 pm | In Ruby on Rails, rails engines, rails generators | 1 Commentif you have not used or not got to know Rails, go to www.rubyonrails.org and find out. But here’s what rails is in 2 sentences.
Web development that doesn’t hurt
Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.
In a less fancy way, rails is an framework that enables agile web development thru the use of Model-View-Controller (MVC) design paradigm.
I am just amazed by how “natural” it is to use rails for rapid development and i would have to say that the great thing about rails are the generators that you can use for User management modules and other typical web modules that most web sites need. Now, rails engines is another way of getting such modules as a plugin for rails and rails engines are getting more and more adapted.
Now the reason that I am blogging about this is because Gizmoojo will be developed using ruby on rails and now i am at the crossroad of deciding between using rails generators or engines for eg. “Login & Users management”.
Rails generators are basically ruby scripts that generates a series of model, views, controller files that the specific modules that you want just like how you would generate a controller, “script/generate controller”. One thing that bothers me when i am considering using the generator approach is that the intend of rails generator is to provide the developer a set of base code to start off and more than often, the developer will be customizing or changing the code along the way. So if there is a newer revision of the generator released, you have no easy way to patch that in. But however, there are quite a number of rails generators that are already available at www.rubyonrails.org.
With rails engines, the whole objective is to allow easy upkeeping of code and software since the core of the plugin lies in the vendors/plugin directory and not coupled with your models and controllers code in your /apps, so its easy to patch the engine you have installed IF you have not made any changes on the engine code installed. So at least that is driving me towards using engines for “Login & Users management” .
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.