"Ruby on Rails" Posts

A Presentation on Capistrano to the Atlanta Ruby User Group

Posted in Presentations, Atlanta, Ruby on Rails, Slingshot | no comments Comments

Cbq
CBQ
04
Oct

A Presentation on with Screech Powers, Cesar Milan (The Dog Whisper), Sean Penn, and guest Ruby celebrity (and Atlanta native) Obie Fernandez. Despite the antics, Capistrano is a powerful, yet simple, bona-fide, big-boy tool. It sure does make our life easier. We like it so much, we’ve made it our goal with Slingshot Hosting to get your Ruby on Rails application up and running with our customized Capistrano Recipes, so you can focus on development.

Capistrano – Atlanta Ruby Users Group PDF

Mini File Uploads

Posted in HowTo, Ruby on Rails | no comments Comments

James
James
03
Oct

I just finshed fixing file uploads in a HighGroove application to work with any size file. I uploaded a 14 byte file to make sure I had things right. This has a few gotchas in Rails, so I thought I would share the recipe for success.

Read more... More

One-Click Rails Deployment

Posted in Heartbeat, Hosting, Ruby on Rails, Slingshot | 6 comments Comments

Cbq
CBQ
18
Aug

It’s tough finding a developer who doesn’t like Ruby on Rails. However, it’s also easy finding developers who think “Rails Deployment” is the next release of a horror movie series.

We’ve developed exclusively in Rails over the past 1.5 years, and a major piece missing from our development process was a simple system for deploying, managing, and monitoring our client applications.

Enter Heartbeat and one-click Capistrano deployment. With Heartbeat, you can run any of your applications’ Capistrano recipes and Rake tasks on a remote system from a single web page.

Watch Heartbeat deploy a Rails application [MOV | 6.9 MB]

Born on RailsDay 2006, Heartbeat is helping us overcome the most difficult part of the Rails life cycle. In a couple of weeks, we hope it will do the same for you.

Three Non-Code Rails Tips

Posted in Community, Ruby on Rails | 2 comments Comments

James
James
08
Aug

There are countless links out there that will bury you in suggestions for how to write Rails code, so I’m going to take the road less travelled and give you three non-code tips that I think are really important.

Read more... More

Synchronizing SalesForce and Ruby on Rails

Posted in Salesforce, HowTo, Ruby on Rails | 1 comment Comments

Derek
Derek
27
Jul

Salesforce, the large Customer Relationship Management tool, and Ruby on Rails, the elegant web development framework, seem like an awkward pair. About as awkward as dipping a Wendy’s french fry in a frosty.

Salesforce is large, often times confusing, and is a tool built for handling lots of different jobs. Rails is lean, elegant, and designed specifically for making web development easier. While Salesforce and Rails are dramatically different, they actually work very well together (much like a Wendy’s french fry dipped in a frosty – trust me).

This unlikely pairing is sparked by ActiveSalesforce, a Ruby on Rails connection adapter to Salesforce-managed data. This Ruby Gem makes working with Salesforce data about as easy as the Rails-MySQL combination.

Highgroove Studios is working on a Salesforce-Rails application, and one of the things we have to do is synchronize a local MySQL database with Salesforce. This is needed because the connection to Salesforce is slower than when working with a local database, and several parts of the application are time-sensitive.

Here’s a look at how we designed the application to synchronize data between the local database and Salesforce.

Read more... More

Metaprogramming and Ruby on Rails

Posted in HowTo, Ruby on Rails

Derek
Derek
27
Jun

Metaprogramming is your secret identical twin that likes doing all of the things you don’t. Need to take out the trash? Just tell your twin. Need to program in Java? Send your twin an email.

Metaprogramming, defined as writing code that writes code by Why The Lucky Stiff, makes scaffolding, associations, validations, and the many magical parts of Rails possible. Implementing metaprogramming techniques can drastically eliminate duplicate code, making your applications far easier to maintain and build. It also lets your code do the work – not you.

CampusSync.com, a client project of ours, is a collaboration site for college students. It has several administration areas that are almost identical, but not a good fit for Rail’s standard scaffolding. The solution to eliminating duplicate code: roll our own metaprogramming solution.

Read more... More

Running Background Jobs in Ruby on Rails

Posted in Heartbeat, HowTo, Ruby on Rails | 3 comments Comments

Cbq
CBQ
23
Jun

UPDATE: rails_cron is no longer available, and daemon_generator has moved. BackgrounDRB has gone through a major rewrite, and I’ve got a chapter on Background Processing in The Rails Way by Obie Fernandez. Thanks to Chris Johnson and Douglas F Shearer for the updated information.

Without a way to run long-running tasks, Heartbeat, our 2006 Rails Day Entry, wouldn’t have had a pulse.

Like Heartbeat, most web applications need to run regulary scheduled or long-running tasks at some point in their life-cycle. These tasks are often not inititated by a web request. How can you check the validity of a URL every 15 minutes? How do we get an eCommerce store to calculate the most popular items every 5 hours? How can we re-index our site for searching every day?

If you’ve ever had to do this, chances are you’ve used cron (the *nix tool used to schedule remote tasks) coupled with script/runner. However, wouldn’t it be great if you could maintain your tasks and background “jobs” inside the ruby language, or even better, as part of your Rails application?

Let’s explore two ways to do this: the excellent BackgrounDRb plugin by Ezra Zygmuntowicz, which was used to power Heartbeat, and the fabulous rails_cron by Kyle Maxwell.

Read more... More

Heartbeat - manage your Rails Apps from a web control panel

Posted in Ruby on Rails, Heartbeat | 7 comments Comments

Derek
Derek
20
Jun

The demo is up – take Heartbeat for a spin.

It’s a single-web page control panel that lets you run any rake task within your application’s directory, from deployment to tests to migrations. If you can write a rake task, Heartbeat can execute it! Additionally, you can use it to monitor the uptime of your URLs.

The app makes extensive use of RJS templates and AJAX.

Heartbeat was built by myself (Derek Haynes) and Charles Brian Quinn of Highgroove Studios during the 24-Hour coding marathon that was Rails Day 2006.

We’ve got big plans for Heartbeat, especially as it relates to Slingshot, our Rails Business Hosting Service. Stay tuned.

Rails Day 2006 Entry: Heartbeat

Posted in Ruby on Rails, Heartbeat | no comments Comments

Cbq
CBQ
18
Jun

Not only were we a Rails Day 2006 Sponsor, but we also competed.

Our entry is called Heartbeat. It’s a simple, elegant, web-based tool for monitoring and maintaining Rails-based applications. From the Heartbeat home page:

Monitor the uptime of URLs and run your application’s rake tasks. Manage your Rails applications from a web interface! Heartbeat can be extended however you want – if you can write a rake task, Heartbeat can execute it!

Here are some screenshots from the application we completed in 24 hours:

Heartbeat HomeHeartbeat DashboardHeartbeat Tasks

We’re not done with Heartbeat just yet. This is only the first 24 hours of development.

Faster Auto-Completion with Rails

Posted in HowTo, Ruby on Rails

Derek
Derek
15
Jun

Auto-Complete is a great tool when it provides possible results BEFORE you finish typing. Unfortunately, using Rails’s included AJAX helpers to query the database as you type often results in a large delay before matches are returned.

However, there is a lightning-quick option: pre-fetch the results in a Javascript array.

In a client project, users can add labels to events on their calendar. To prevent users from creating variations of the same label name (i.e. – “favorite” vs. “favorites”), we needed to provide faster auto-complete functionality than that available through Rails’s provided AJAX helpers.

We created a simple helper method for this case (special thanks to Chad Fowler and his Rails Recipes book for the inspiration).

Take a look at the local_auto_complete_field helper method. TXT

To call the function from your views:
<%= local_auto_complete_field('name',@labels) %>

In the above example, we are adding JavaScript-powered auto-complete functionality to the 'name' text field. The JavaScript array is generated by calling #name on each element in the @labels array. To override this behavior:

<%= local_auto_complete_field('name',@labels, 
                              :method => 'description') %>

Here’s to faster auto-completion!

Older posts: 1 2 3