Topic: Project Website

Project Website Part 5: Morph in 11 steps or so

BD3787F1-7967-4CE0-AF3F-AA9E36AD6AA3.jpg

Eventually in the course of developing the Project Website application, it was time to put the project on a staging server for client viewing.

Often we'll host that ourselves, but in this case I decided to try out Morph, which provides a relatively inexpensive virtual hosting environment for Rails applications, using the Amazon Web Services cloud. Even better, Morph allows you to set up a development environment for free. (The free version is limited in size and bandwidth, and they also apparently will shut down the server if you don't deploy for 30 days -- a limitation obviously not shared by the paid environments).

I was able to go from total Morph ignoramus to running deployed app in under two hours. After reading this you should be able to do it even faster. (Full disclosure: Morph and Pathfinder are co-sponsers of the WindyCityRails conference September 20, 2008. That doesn't really have anything to do with anything, I just wanted to mention the convference)

Here are the steps:

Continue reading »

Project Website Part 4: Drag and Drop in jQuery

4BE91917-A3EB-4A6A-BB40-BC4A4F929926.jpg

Drag and drop is like those Nutty Bars snack things.

Allow me to explain.

I like Nutty Bars. But I never expect to like them. They are kind of funny looking, for one thing, what with that weird criss-cross pattern on the top, and the chocolate never quite covering the wafers. But when I get past that and actually eat one, it's actually kind of tasty.

Which brings me to drag and drop. Which I always expect is going to be an overwhelming pain in the neck (probably based on bad experiences using Java Swing). But whenever I manage to get over it and actually implement a web drag and drop, I'm always surprised at how easy it is using an Ajax framework.

jQuery is no exception.

Continue reading »

Project Website, Part Two: Simple jQuery With Rails

project_website.jpg

This is something of a mix between what I've been doing on the http://www.pathf.com/blog/tag/project-website/ posts with my more typical "here's how you do something in Rails" post. I'm going to describe how to use jQuery to manage JavaScript and Ajax in a Rails application rather than Prototype and Scriptaculous.

Conclusions, Up Front

The benefits of using jQuery on a Rails project seem to be:

  • A lot of basic behavior can be specified with much less JavaScript then in Prototype/Scriptaculous, making it feasible for even somebody with my JavaScript skills to write complex behavior directly in JavaScript. I found myself doing things client-side in jQuery that I would have done with a separate Ajax call before.
  • In particular, certain kinds of behavior are almost ridiculously easy -- especially the case where you want every element of a certain kind to have similar behavior. So for instance, if you were, say, maintaining an iPhone plugin and wanted all links of a certain kind to trigger Ajax calls and slide left like a native iPhone app would, jQuery would be a pretty easy way to get there.
  • Creating a Web site that is functional without JavaScript is a much easier and cleaner process using jQuery.

There are a couple of costs, especially from a Rails application

  • You lose some or all of the Rails helper methods for writing JavaScript. You can keep some of the helpers by using the jRails plugin, but using that plugin minimizes some of the gains of using jQuery.
  • The biggest loss for me was assert_select_rjs and the lack of unit testing of jQuery behavior. As much as JavaScript development tools have improved, there are still gaps in testing browser-centric behavior.

Continue reading »

Project Website, Part One: Migrating Data

project_website.jpg

Now that I've explained the state of play on our Project Website application, it's time to role up my sleeves and get started.

rails -d mysql

For those of you that haven't done this in a while, the -d mysql is needed since Rails 2.0.2 and up use SQLite3 as the default database.

I suspect that everybody who has worked with Rails for a while has their own way of building up from the basic app skeleton to get to a useful structure. Here's mine:

Continue reading »

Project Website Part 0: Introduction

project_website.jpg

One of the frustrations of trying to learn any programming tool is the lack of well-described real-world examples of how to use the tool in practice. Although open source tools make the underpinnings of successful software more explicit, documentation that combines a real example with a description and rationale of the choices made is still rare.

And so: Project Website. For various reason that aren't worth going into, I find my self rebuilding a small Web site in Rails, followed by the creation of version 2.0 of thee site with new features. I'm planning on blogging about the process on this site, with emphasis on the design and architecture decisions involved in taking the site forward. I can't mention the name of the client (at least I don't think I can), so some specific details will be fuzzed, but I'm going to make as much of the code and design rationale available as I can.

This first installment of the series will take stock of the current state of the application and the most critical needs for the new version.

Continue reading »

Launch: Pathfinder Newsletter

    Get a monthly update on best practices for delivering successful software.

    Subscribe via email


    Subscribe via RSS      RSS icon

Topics

Search

WordPress

Comments about this site: info@pathf.com