News and Blog

Permalinks, Slugs and Friendly URLs with Ruby on Rails

December 30th, 2009 » No Comments »

One thing almost every customer hates to see is http://domain/resource/id.  They will complain that they look bad.  They will cite that they can’t remember the URL because of some number that doesn’t mean anything.  They get nervous that investors or others will know they only have a certain number of records.  They will get nervous that people will just try random numbers and get data that doesn’t make sense.  Savvy clients even will complain that it will hurt their ability to rank well on search engines for their content.

There are lots of ways to work around this, but there are a lot of little gotchas.  Data can change and your URL’s can break and disrupt your SEO.  If there is lots of similar content there is difficulty in making sure URLs stay unique.  As an application grows it can become a pain to maintain friendly URLs.  Don’t forget possible name spacing issues.

A plugin by Norman on Github called FriendlyId solves all the problems at once.  If you need to do Friendly URLs, permalinks or want slugs check out this plug-in.

Some nice  features

  • Slugged/Non-Slugged Models
  • Slug Versioning
  • Unique Slug Names
  • Reserved Names
  • Slug Caching
  • Scoped Slugging
  • Text Normalization
  • Diacritic-sensitive Normalization
  • Unicode URLs
  • Custom Slug Generation

Plot Points on Google Maps Painlessly With Ruby on Rails

December 28th, 2009 » No Comments »

We have had several projects over the years that have needed to plot points on a google map.  Rails pre-1.0 didn’t have a ton of options and we always just dealt with the javascript directly as it wasn’t all that bad.  It was verbose, but not too painful.  We had talked about putting together a plug-in to abstract out the grunt work, but never got around to it.  It always seemed that enough time would pass between projects that the pain was never high enough.

Working a project this weekend I decided to check what options where out there and stumbled upon google_maps plugin by bhedana on GitHub.  In a few minutes I had it installed and rendering maps without any of the pain in setting up maps manually.  This plug-in gives you moderate control of the map.  You can customize controls, center, zoom, add custom markers and plot polyline routes.

If you are doing anything with plotting points on a Google Map in Ruby on Rails you should look at this plugin-in.  If you have a better plug-in for maps please let us know.

Work Queues with Ruby using Redis (Resque)

December 21st, 2009 » No Comments »

Do you have a need for asynchronous work queues?  Need in memory storage that writes cache to disk?  You might want to check out Redis.  Redis is an advanced key-value store. It is similar to memcached but the dataset is not volatile, and values can be strings, exactly like in memcached, but also lists, sets, and ordered sets. All these data types can be manipulated with atomic operations to push/pop elements, add/remove elements, perform server side union, intersection, difference between sets, and so forth.

We have been using Redis quite a bit lately especially for iphone applications using Ruby on Rails backend systems.  It allows for greater scalability and better management for jobbing various processes.  Chris Wanstrath has put together a great redis backed library called resque.  He lays out our position pretty much spot on.  If you need a background job system do yourself a favor and check out Redis and Resque.

Testing Multiple Versions of Internet Explorer

December 18th, 2009 » No Comments »

Do you find yourself having to test your work on a number of Internet Explorer browser versions?  You should check out the Internet Explorer Collection.

Internet Explorer Collection contains multiple IE versions, which are standalone so they can be used at the same time.

Conditional Comments work exactly the same as in the native versions. The original version number is shown correcty in the User Agent string. The version number can be found in the window title too.

Internet Explorer Collection also includes the Internet Explorer Developer Toolbar 1.00.2188.0. This Explorer Bar provides a variety of tools which make troubleshooting websites easier. The Internet Explorer Developer Toolbar is compatible with Internet Explorer 5.0 and higher when using Windows 2000 or higher.
Internet Explorer Collection contains the following versions of IE:

* Internet Explorer 1.0 (4.40.308)
* Internet Explorer 1.5 (0.1.0.10)
* Internet Explorer 2.01 (2.01.046)
* Internet Explorer 3.0 (3.0.1152)
* Internet Explorer 3.01 (3.01.2723)
* Internet Explorer 3.03 (3.03.2925)
* Internet Explorer 4.01 (4.72.3110.0)
* Internet Explorer 5.01 (5.00.3314.2100)
* Internet Explorer 5.5 (5.51.4807.2300)
* Internet Explorer 6.0 (6.00.2800.1106)
* Internet Explorer 6.0 (6.00.2900.2180)
* Internet Explorer 7.0 (7.00.5730.13)
* Internet Explorer 8.0 (8.00.6001.18702)

Not running windows?  Using a virtual machine on GNU/Linux or OS X plus this collection takes the pain out of setting up Internet Explorer test environments.  You do test on Internet Explorer right?

To Eager Load or Not Eager Load.. Is That The Question?

December 17th, 2009 » No Comments »

Looking to increase your Ruby on Rails application performance?  One easy way is to reduce the number of queries it makes.  Bullet is a great plug-in that watches your queries and notifies you when you should add eager loading (N+1 queries) or when you are unnecessarily using eager loading.  We have started to use Bullet in development and staging environments.  It even supports Growl.

Analyze MySQL Queries.. Index Optimization

December 16th, 2009 » No Comments »

It is so easy to forget to put index in the right places as you grow an application.  Often times you will see an application degrade in performance as more users start using it.  Usually some simple database tuning will go a long way in radically improving response times.  Missing indexes on complex joins can speed things up by more than a factor of 100 in a lot of cases.

I.NFECTIO.US has created a query analyzer plugin that will output MySQL EXPLAIN statements for every query in development mode.  Armed with this information it is easy to add indexes, reorder your joins and remove unneeded or redundant indexes.
Terminal — less — 170×37
To install:
script/plugin install http://svn.nfectio.us/plugins/query_analyzer

Saving Arrays, Hashes, and Other Objects In Text Columns Using Active Record

December 15th, 2009 » 2 Comments »

Have you ever wanted to store an array, hash or object in a database column?  Using Active Record and YAML makes this completely painless.  To do so, you must specify this with a call to the class method serialize. This makes it possible to store arrays, hashes, and other non-mappable objects without doing any additional work.

Class_ ActiveRecord__Base

You can also specify a class option as the second parameter that‘ll raise an exception if a serialized object is retrieved as a descendant of a class not in the hierarchy.

Class: ActiveRecord::Base

Nothing new here, but something that can be pretty powerful.  Working with people not used to Ruby or ActiveRecord brings back some of the nice “magic” we take for granted on a regular basis. (Samples taken directly from Ruby on Rails API Documentation)

MySQL Performance Enchancements

December 14th, 2009 » 1 Comment »

We recently started using Percona XtraDB on a project.  If you need to speed up MySQL this is a great backwards compatible drop in replacement that is designed to better scale on modern hardware, and includes a variety of other features useful in high performance environments.  If you are looking for quick and proven MySQL performance increases you definitely want to check out Percona, they also offer a number of scaling services if you find yourself in over your head.

Integrum Named One of Best Places To Work

December 13th, 2009 » No Comments »

Best Places Winner '08 4c

Every year Phoenix Business Journal and Best Companies AZ work together to determine the best places in Arizona to work.  We are honored that for 2009 we were listed as one of the Top 20 Best Places to Work in Metro Phoenix.  It can all be attributed to the great people that work here!

Who Do You Use For Hosting? SliceHost.

November 10th, 2009 » 1 Comment »

We often get asked, “who do you use for hosting?”. When RubyOnRails was pre 1.0 we were rolling and hosting our own because deployment was so vicious, but that was a time long ago. We have for some time been using SliceHost and couldn’t be happier. We have even created a script to automate setting up a rails stack on a slice, we should probably release that to the public. Slicehost is pretty cost effective for staging and sandboxes at under $25/month and scales decently while being affordable for production. However, the real magic of SliceHost is the fabulous service.

Often we will start a customer out on a small development slice on our SliceHost account. Then as things get moving and they get their own SliceHost account created and ready to go, we can very easily move a slice from our account to their newly created account, no interruption of service. Generally we submit a ticket and within 5 minutes we have a response and the slice is moved. It is hard to not recommend a company that is that responsive to your needs. SliceHost keep up the good work!  In fact, they just move a slice for me in less time than it took to write and publish this post.

What People are Saying

"Integrum helped us find creative solutions to some very unique challenges. In one case, we needed a way to quickly and easily provide alerts on our website when buses run late or go on detour, and we wanted these alerts to come directly from our Customer Service Department. Integrum worked with our reps to custom build a tool that gives them control over the info."

— Mike Brady, www.valleymetro.org

Announcements

So…you’d like to work for Integrum?

With a stable of long term clients and growth on the mobile development side as well, Integrum is looking to bring more talented developers to our team.  We’re currently looking for Rails developers from n00b to the cliched ‘rockstar’ level.

We do real Agile (capital A because we don’t fake it) and SCRUM development, so you’ll have to be comfortable talking with clients on a regular basis.  If you’ve got an interest in iPhone or Android development to go along with the Rails stuff, that’s a nice bonus too.

These are full time positions, on-site at our office in Chandler, Arizona. Benefits, perks, Pac-Man, we’ve got all those. Salary is dependent on experience.

Ready to apply? Here’s our job application — a little test.

Below is what you will find in the README for the job application on github.

Please note that these tests all require some basic Ruby knowledge. If you don’t know ruby, take a few minutes to learn the basics. You will need to have Ruby, rubygems, RSpec installed, and Factory Girl installed.
In order to be considered for a position at Integrum, you must follow these steps.

1.    Fork this repository (if you don’t know how to do that, google is your friend)
2.    In the refactor-this directory you will find some Ruby code that needs to be refactored.

  • A test suite is included with failing specs.
  • Please refactor this code, this is real code we found in a real project that could be much more readable and intuitive.
  • Run spec helper_spec.rb to execute your specs and see if they are passing.
  • Please note: feel free to change the specs, but they should all be passing when you turn in your code.

3.    In the github-challenge directory, please create a Ruby script that accomplishes the following:

  • Connect to the github API
  • Find the rails/rails repository
  • Find the most recent commits
  • Print out HTML that groups the recent commits by author.

4.    Add your resume to the resume directory
5.    Commit and Push your code to your new repository
6.    Send us a pull request, we will review your code and get back to you

For more information, contact Chris Conrey at conrey@integrumtech.com or hr@integrumtech.com.

MountainWest RubyConf 2009

We’re sponsoring this years MountainWest RubyConf, March 13-14. Are you going? You should be there – we will be! For more information visit http://mtnwestrubyconf.org/2009/.

Gangplank Hacknight

What is Hacknight? The best way to find out is show up. It is whatever we make it.

Gangplank Academy

Come to Gangplank, same address as Integrum, each Wednesday at 11:45 a.m. for brown bag lunch and a presentation.

Calling all Rails Nerds!

We want you (to work for us)! Drop us a line at hr@integrumtech.com.


Press Room

Integrum wins Small Business of the Year award

How do you know a company deserves an award? When the staff is so focused on going above and beyond for clients, they miss the call from the city notifying them they’ve won.

Fortunately, the City of Chandler was able to track the staff at Integrum down and award them the 2010 Small Business of the Year award at a banquet held last Wednesday.

The 23rd Annual Awards Dinner took place at the Crowne Plaza San Marcos Resort in downtown Chandler. The event celebrates individual and business excellent in the community. Integrum was chosen based on the company’s contributions to the growth of the local economy, high quality service and innovations in the field of software development. Additionally, Integrum was recognized for the company’s community involvement through its nonprofit, Gangplank.

Jade Meskill and Derek Neighbors were on hand to accept the award.

Where We’re At:

  1. Hacknight Every Wed.
  2. Gangplank Academy Brownbag Every Wed.
  3. Boulder Startup Week May 4th-7th

Updates