Pathfinder Blog
Topic Archive: rails

From JSP to Ruby on Rails: First thoughts on front-end coding conventions

Now that I've got a few Ruby on Rails projects under my belt, I finally feel qualified to comment on Rails front-end coding conventions. As a UI specialist coming to Rails from the JSP world, I find a lot of room for improvement in the RoR approach to view-layer code. I love working on the non-view aspects of RoR projects, but I find I've got to do tons of cleanup at the ERB layer. Expect to see some open-source components from Pathfinder to help ease this pain. In the meantime, let me articulate my pain points:

Code organization

If I'm filling a front-end role on a Rails project, most of the files I need are in /app/views and /public. I dig that. Likewise, I appreciate the underscore naming conventions for partials. However, I wish /layouts weren't just another subdirectory of /app/views. Layouts are inherently different from standard view templates. A better hierarchy within /app/views would help drive this home. Likewise, I wish partials and full templates each had their own directory within a specific controller's view folder. That would help keep directories manageable on big projects. The /public directory, on the other hand, offers just the right amount of organization.

Continue reading »

Topics: , , , , , ,

Installing Edge Ferret/acts_as_ferret

If you do a gem install ferret, you will be getting 0.11.6. The latest stable version of acts_as_ferret is 0.4.3. Both of these versions were released nearly a year ago in November 2007. Since then, there have been various performance improvements and bug fixes which you'll be missing out on. In order to get the latest versions, you'll need to do a little bit of work but I would recommend it if an update is feasible for you.

Since it will be the easiest, let's begin with acts_as_ferret.
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: , , , ,

Speed Up Ferret/acts_as_ferret Bulk Indexing

Those of you using ferret 0.11.6 (the latest released gem) and acts_as_ferret 0.4.3 (the latest stable version) may have noticed that rebuilding an index can be painfully slow when working with a large number of documents. Even if each document contains a relatively small amount of text, indexing crawls with a large set of documents. The problem is a result of how bulk update works; "bulk indexing" processes a single document at a time! Fortunately, there is a simple patch which will provide a significant speed boost.

Continue reading »

“Build half a product, not a half-assed product” - tips on clarity and focus from Jason Fried of 37Signals

Jason Fried from 37Signals spoke yesterday at the ITA "Speaking of Success" event, about the history of 37Signals, their philosophy and culture, and the critical business decisions they've made to get them where they are today.

The software biz is fundamentally broken. Too many products fail because of the obsession of adding more and more, and trying to do too much.

Jason went on to say that the approach of adding more and more only works for companies that have lots of money and lots of time, but that for the average company the main goal should be to build something that is "good enough," get it out to the users, and improve the design based on their feedback. The challenge of which features to include, and which to say "No" to, is covered well in the "The Innovator's Dilemma," which he said "everyone in this room should have read." The book resonates the core philosophy of 37Signals, which is evident from their blogs, their book "Getting Real," and the design of the Rails framework. As an example of the "Good Enough" philosophy, Jason used his laptop and its basic webcam to stream the Q&A session out over justin.tv and send out a text to the 37signals Twitter group. "The quality probably isn't that great, but its good enough," and with that quick setup he had now broadened the audience by 1,000 users or so. (I searched for the video archive at justin.tv, but didn't find it yet.)

Continue reading »

Topics: , ,

Ruby on Rails with Windows - How I made it work

I have been developing with Ruby on Rails over the last few weeks. Coming from the ASP .NET/C#/VB world, I am a total stranger to a programming language like Ruby. Any new programming language is fun to learn! Ruby was even more exciting cause it was a new kinda language to me. Though I think Ruby is not as user-friendly as C# or Java, it is as powerful and flexible if not better. Combined with Rails, Ruby becomes a platform that facilitates quick and efficient development of database-driven web applications.

Continue reading »

Topics: , , ,

jQuery + Rails + Agile: PlantCollections database project now live

After just three weeks of frantic work, my team today released the first public version of PlantCollections, a joint venture of the Chicago Botanic Garden and 29 academic and corporate partners.

Our app serves as the consumer-facing front end for a Google Base collection of plant specimen data compiled by scientists and gardeners all over the world. This project represents my first experience with Ruby on Rails and Pathfinder's first experience progressively enhancing a Rails app with jQuery. Although this is still little more than a prototype, with lots of additional functionality to come, we're pleased that this first release is already out in the wild. Go, agile, go!

To learn more about PlantCollections and our involvement in the project, check out the press release. Otherwise, just head straight to the application itself.

Topics: , ,

Selling colleagues on progressive enhancement

Achieving progressive enhancement at the view layer takes a lot of coordinated effort between server- and client-side developers. A lone UI developer can't make it happen without assistance and buy-in from the rest of the team. I'm not talking about selling the client or the business team. I'm talking about selling one's fellow developers.

I used to work for a giant company (Orbitz) with a large team of front-end developers and total organizational buy-in about accessibility and web standards. It took Orbitz years to get there, but once it did, progressive enhancement was the gospel.
Continue reading »

jRails: Ruby on Rails with the Prototype guts ripped out

My esteemed colleague Noel Rappin sensibly advocates doing things the Rails way whenever possible. As a Rails noob, I should follow his advice. But as a dedicated user interface developer, I'm already finding that many of the best practices of my discipline take extra steps to enforce in Rails. Case in point: The ability to write unobtrusive JavaScript using my tool of choice, jQuery.

Continue reading »

Using ActiveRecord and Metaprogramming to Define Constants for Enumerated Types

A Code Monkey Writes Enumerated Types for Fruit

Have you ever stored your application's enumerated types in a database? If you have, you might have also noticed that code will often times "duplicate" this data by defining constants or enums that reference what is in the database. If you're anything like me, this duplication does not feel right.

With the metaprogramming capabilities of Ruby, we can address the maintenance costs of duplication by generating these constants at runtime.

Continue reading »

Topics: ,

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com