Third rails

My summer break is over, but in the brief few weeks I had I took a third run at Rails, or Ruby on Rails to be more precise. I had started with the example blog application from the online tutorial. It is a pretty good representation of how you can very quickly, with the use of scaffolds, get the basic structure of an application up and running. I even played around with it customizing the layout of the blog, although that is mostly just rewriting the html portion of the .html.erb files.

Then I went through the Depot application from Pragmatic Programmer’s Agile Web Development with Rails. It introduces a lot more features than the Blog application, and the most of the 700+ pages of the book are a pretty deep exploration of the Rails environment. In fact a lot of it was too deep for me to really understand the first time through.

I felt that I needed to explore on my own rather than simply following a guided track to producing a half finished sample application. I have had a project in mind for awhile, so after getting about halfway through Foundation Rails 2 I struck out on my own. Rails2 is a significantly different kind of book than Agile Web development, were Agile is a long deep look, even the depot application is fairly involved, Rails2 takes a number of quick strafing runs at the framework, each one designed to expose one or just a few aspects of the framework. The result is that any code unrelated to the lesson at hand is not present to possibly confuse the reader. I found that this provides a much clearer understanding of how Rails works. Undoubtedly this approach glosses over some details, but that is were the strength of Agile Development comes in, it provides the deep background to fill in any gaps from Rails 2.

About my application; I designed it to be written in three phases: first just a adaptable brochure-ware website. Rails is total overkill for this, but I figured it would be a good starting point as I developed my skills. Next I would add a public photo gallery option for the sites target; a photography business. The third and final stage adds private proofing galleries for customers to pick photographs for processing and ordering of prints, all automated through the site.

I accomplished most of the first phase, although the application is very brittle. I started out by thinking about my data structures for several hours, I still got them all wrong. I have added, subtracted and changed columns in the database a half dozen times as the application evolved. I still have several changes that need to be made, although I am thinking about taking what I have learned and just starting over from scratch. I have learned a lot, in fact I have already rewritten every original line of code several times (and no doubt need to again).

At this point the application has page objects that have associated image and text objects, these objects can be created and edited through an interface (still under construction) and they can be linked to new pages for navigation purposes. The objects are all shaped and position by using inline css values that are held in the database. An approved administrator can log in and edit the applications elements through the web interface. As I mentioned the application is still very brittle and I will likely start over from scratch now that I have a better idea of what the objects should look like and how the applications logic will work. So, until then, I have no code up, although I will eventually get it up on github, or some other code hosting site.

For now I have to get back to the Fall semester at school.

Advertisements

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