TechDev

How to serve static websites and Passenger Rails projects from the same Mac OS X Apache instance

When your http://localhost/~username/ sites go haywire, it's time to dig into your Apache config files

OS X Apache default

As Rails pros know, Phusion Passenger allows you to serve multiple Rails apps on the same Apache webserver instance with few configuration or deployment headaches. When you install it in your local Mac dev environment, you can easily work on a bunch of Rails projects simultaneously without having to manually start and stop individual server instances all the time. The OS X Passenger preference pane makes deployment even easier. Just add a project, give it a custom local URL, and point it at a directory. You're good to go.

But what happens if you're already using OS X's built-in Apache webserver to dish up local content such as PHP applications or static HTML? When I first got Passenger up and running, all of my local sites in /Users/<username>/Sites/ stopped working. It took a bunch of digging, but I eventually realized that something in my Apache configuration had gotten messed up during the Passenger installation process. I was missing the configuration file for my OS X user account. OS X generates this file the first time you enable web sharing for any individual user. It's responsible for mapping your /Sites subdirectory to localhost URLs, so that http://localhost/~<username>/myapplication/ points to /Sites/myapplication/index.html.

Continue reading »

acts_without_database: Leverage ActiveRecord with Non-Database Backed Objects

ActiveRecord comes with a lot of nice things that aren't really dependent on having a database backed model. The most obvious example of this is the validation framework baked into ActiveRecord. Also, there are several plugins which add some useful behavior to ActiveRecord objects but don't rely on having a database.

In the future, I believe the rails team aims to make certain things more modular and easier to pull out and use separately from ActiveRecord (validation being one of those). However, if you are working on a project which is locked into a certain version of rails or you're impatient, there is a very simple plugin which can solve your needs.

Enter acts_without_database...
Continue reading »

Category and UI changes on Pathfinder blogs

If you read one or more of the Pathfinder blogs in our web interface, you may have noticed some tweaks to our navigation and top-level categories. Our goal in making these changes was to help different audiences drill down to the specific content that interests them. Instead of just a few top-level categories, we now boast around 20, though many posts appear in multiple categories. To subscribe via RSS to any specific category - or to our entire feed - just visit our Feeds page.

Topics:

Receive 10% off Web Form Design: Filling in the Blanks by Luke Wroblewski

Web Form Design cover image

Rosenfeld Media contacted me after I published my review of Luke Wroblewski's "Web Form Design: Filling in the Blanks." They offered Agile Ajax readers 10% off "Web Form Design" or any other purchase at rosenfeldmedia.com. To redeem, simply enter the code PATHFINDER at checkout.

Using Flex Code Generator (FCG) with Flex & PureMVC

Recently I've been working on a Flex prototype using the PureMVC framework. I will talk at length another time about just how much PureMVC successfully solves a lot of problems that we encounter in interface development and especially about how much this framework is important for all those complex interactions that we expect out of our RIA interfaces.

Starting out with PureMVC is not a particularly easy task. It is a good thing that there are decent documentation and examples, at least for AS3. At first when I read the documentation, it made sense only on a high level, but translating that high level understanding to code right away was out of the question. I solved this initial sticking point by looking at a couple of AS3 examples like CafeTownsend and EmployeeAdmin, where you can see how the framework works on the right size demo app, not too big and not too small.

Continue reading »

Book recommendation: Web Form Design: Filling in the Blanks by Wroblewski

Web Form Design cover image

Usability and design guru Luke Wroblewski knows that web forms suck. More importantly, he knows why - and how to make them suck less.

For the past few years, the Yahoo! product design exec has been presenting his ongoing research into the humble HTML form at conferences and on his blog, Functioning Form. I attended Wroblewski's presentation at An Event Apart Chicago 2007 and came away super-impressed. His persuasive mixture of case studies, existing research and newly commissioned usability studies helped shed light on the patterns and anti-patterns that determine whether users successfully complete your forms or give up in disgust.

All of Wroblewski's preparation came to fruition earlier this year when he published "Web Form Design: Filling in the Blanks" (Rosenfeld Media). After finally taking the time to read the book cover to cover, I'm mad at myself for waiting so long.

Continue reading »

Scriptaculous Drag and Drop with AJAX Update Fix for IE

If you have used scriptaculous to do drag and drop interactions which result in a replacement of the DOM element you are dropping into, you may have noticed that you can only do one drag and drop before it breaks in IE. The problem occurs when you replace a DOM element which is defined as a Droppable; IE will fail because it will still have the original element registered as a Droppable but it does not handle the fact that it no longer exists in the DOM. Firefox and safari have no issue with this, so this is another frustrating IE specific issue.

Fortunately, this problem is easily solved with a single line of javascript.
Continue reading »

Google Analytics Tracking Component for Flash Platform

Although it's not too hard to set up Google Analytics tracking on Flash based web sites the traditional way by referencing JavaScript, there are still good chances for something to go wrong in the process and debugging it is notoriously hard. The good people at Google have provided the Flash Platform Developer community with a great "little" library that wraps the whole process and provides a good debugging mode.

Continue reading »

Pathfinder releases version 1 of its Flash Platform microsite (codename Mica)

You can see the site here. Come often as it will be updated on a regular basis.

The goal of this site is to shed more light on what is it that we do here at Pathfinder with the Flash Platform.
We would be very grateful to hear feedback about the site from any perspective.

Continue reading »

Bandwidth profiling Flex projects and more with Charles

Adobe Flash comes with a very useful feature for bandwidth profiling. It allows you to see how will your site/app act under certain network conditions.

Flex Builder unfortunately does not have that option so we have to look somewhere else for a solution for testing.

While there are many applications that simulate various network conditions, Charles stud up as the most practical for Flex developers, in my opinion.

Continue reading »

Testing various roles in ruby on rails

On pretty much every project I've ever been on, there have always been various roles in the system that experience different behavior. Admins can generally do everything, end users get the least functionality, and there are always a few in between that vary based on requirements. Unfortunately, all too often all possible scenarios aren't tested, or they test only positive cases for each role.

In my current Ruby on Rails project, I am checking all roles and ensuring those who should be able to do certain things are able to, and those that shouldn't are unable to. What I have found, is that usually, the Admin and one other role can usually do a set of things, and every other role can't. So, I find that I set up my tests the following manner:

['root','hr'].each do |role_name|
    context "logged in as #{role_name}" do
      setup do
        login_as_user(role_name)
      end
 
      should 'index' do
         get :index
         assert_response :success
         # other assertions
      end
  end
end

Continue reading »

Skinning Flex with Illustrator CS3

There is many ways to skin Flex applications. To name some that I've used: Flex CSS, Programmatic AS3, Flash, Degrafa, Photoshop (JPG's, GIF's and PNG's) and Illustrator.

What usually needs to happen on a project is a combination of some or all of the above. Not having a single point of reference for skinning creates quite a bottleneck.

From different approaches, two surfaced as having the best pipeline: Illustrator CS3 and Degrafa. If we are talking speed and ease of graphic design, I would now default to Illustrator CS3. For advanced skinning and interactions Degrafa holds first place.

Continue reading »

Rails, AMF and Flex

I've just completed a project where I was the Rails developer for a site that was integrating a Flex application that needed to pull from a database. A primary consideration is how to transport the data.  Rails supports xml and json natively, and is very easy to set up by adding a single line to a controller's respond_to method. Sasha, the Flex developer on the project, suggested that we go with AMF if possible as it's native to Flex and is deserialized straight into custom typed objects.

After reading a bit about some performance considerations it looks like AMF and JSON are going to get roughly similar performance in most cases, so it becomes a matter of ease of development and taste.  Sasha definitely preferred working with AMF, so i started checking out Rails implementations.

Continue reading »

Topics: , , , ,

A Java Programmer’s transition to Ruby on Rails

There is much out there on the topic of migrating to Ruby on Rails for an experienced Java programmer. I figured I'd add my two cents, as I have finally drunk the Kool-Aid. I switched to Ruby on Rails late last year, and developed a subscription and content management system in Ruby on Rails, went back to a Java project, and then back to Ruby on Rails. The switch back to Java gave me an interesting insight into the things I love and hate about both development platforms.

Continue reading »

Defining RIA Interaction Patterns on time in Flex Agile Development

Putting more attention to User Interaction Design is naturally becoming a standard practice with RIA.

With RIA technologies, classic Interaction Patterns are only building blocks, not solutions. With raised possibilities, Patterns have become more complex.

Continue reading »

Who is Pathfinder?

Topics

Recent