Articles

Baby Shoes Embedded Ruby 1.9.1

Setting up Amazon RDS for Heroku / Rails

Amazon has a mysql service. It scales up to 68gb ram and deals with backups for you. Heroku lets you use this. This means that rather than paying for the Ronin DB plan, you can just make your own db with RDS on aws and only pay for dynos from heroku. Plus, if you’re tied to mysql, you don’t have to spend tons of time dealing with postgres.

This is all pretty awesome.

Env

First, d/l the RDS cli here.

solution to fix issue where heroku doesn't serve css, images and static files

Heroku is cool, but it took me forever to figure out why it wasn’t serving my css and images. It was basically returning 404 for any file in the public directory.

I just got errors like this:


ActionController::RoutingError (No route matches "/javascripts/base_packaged.js" with {:method=>:get, :canvas=>false}):
/home/heroku_rack/lib/static_assets.rb:9:in `call'

Given that the app that I’m trying on Heroku is also running perfectly well in production on slicehost, this was pretty confusing.

Quick Tip: MongoMapper::DocumentNotFound

If you’d like to get a 404 response when you encounter a MongoMapper::DocumentNotFound error, which is the default response for ActiveRecord::RecordNotFound, simply toss this in your initializer where you set up your Mongo connection (I use config/initializers/mongo.rb):

ActionController::Base.rescue_responses[‘MongoMapper::DocumentNotFound’] = :not_found

Anachronic and Vines, calling time on my plugin virginity

I released my first two real open source projects this week, both Ruby. Kind of nice, never thought it would happen, then it just did.

Vines is a (very small currently) bundle of useful general step definitions for Cucumber, it's not currently rails specific, and I may make rails-specific steps a different include so it can be used for regular ruby projects.

The only step currently available is very simple, but not provided by cucumber. From its own feature tests:

Running rake task in background and not blocking the port

In this screencast Ryan Bates explains how to execute a rake task in background on run time. This will make controller return the response to the user fast. In the meantime email will be sent through the background job.

In short this is the solution he proposes.

State of Ruby VMs: Ruby Renaissance

Ruby is commonly associated with the frameworks (Rails, RSpec, and many others) that it enabled, but it is much more than that. The same ideology and design principles that popularized the language at the start are also the reason why it is being currently ported to a variety of alternative platforms: JVM, Objective-C, Smalltalk VM and Microsoft’s DLR.

Setup Ruby Enterprise Edition, nginx and Passenger (aka mod_rails) on Ubuntu

The following is a very short guide on setting up Ruby Enterprise Edition (REE), nginx and Passenger, for serving Ruby on Rails applications on Ubuntu. It also includes a few quick and easy optimization tips.

We start with setting up REE (x64), using the .deb file provided by Phusion:

The Ruby Show 101: Let's put another shrimp on the barbie!

Episode #101 Let's put another shrimp on the barbie!

Rails Envy Podcast – Episode #101

Episode #101 Let’s put another shrimp on the barbie!

ajax | Rails Fire

ajax

Episode 246: AJAX History State

The new pushState function in JavaScript allows us to change the full URL with AJAX. This means the back button, reloading, and bookmark support can be easily added.

Video: 

Faye: Simple Pub/Sub Messaging for the Web (and Ruby!)

http://faye.jcoglan.com/Faye is an easy-to-use publish-subscribe messaging system based on the Bayeux protocol. It provides message servers for Node.js and Rack, and clients for use in Node and Ruby programs and in the browser.James Coglan

GitHub Rebase #38

Welcome to Rebase 38. Suggestions for projects to cover are always welcome, check out the criteria here. In the meantime, check out this preview of some neat visualizations using the GitHub API of how developers are connected:

Showcasing RubyLearning’s Awesome Rubyists

Showcasing RubyLearning’s Awesome Rubyists

RubyLearning has been associated with some amazing, talented Rubyists these last 5 years. I am compiling a list (in alphabetical order) showcasing these awesome Rubyists who have either undergone some of the courses at RubyLearning or have been instrumental in taking RubyLearning to the next level.

jQuery Ajax

PeepCode Meet jQuery quickly became our fastest-selling title of all time. In this screencast, we explore the Ajax features of the popular jQuery JavaScript framework.

We start simply with the transfer of HTML fragments in only one line of code. You’ll learn about the convenience methods in jQuery and then dive down into the details of the low-level Ajax method.

Using Prototype and JQuery with Rails3 (UJS)

I've been look for some information on the unobtrusive javascript features in Rails 3, and it turns out that there's not much out there! Either that, or I'm looking in the wrong places.

So here is my attempt to explain some of the features. I'll create two sample blog apps, one using Prototype and the other using JQuery (the code is available on github).

Install Rails 3

If you haven't already, get Rails 3 installed. Everything you need to know is here.

Sikwamic: Simple Key-Value With Comet

GET: http://github.com/dorkalev/Sikwamic

What is it good for?

LOOP CHAT!

LOOP CHAT!

This is a dead simple proof of concept for a chat the comet way.

My motivation for creating this proof of concept is the lack of DEAD SIMPLE implementations of commet around.

GitHub Rebase #35

Rebase: good for reorganizing commits, squashing down changesets, and repairing dentures.

Rails Autocomplete without Ajax (Autocompleter.local)

This was fun - though not easy to find the answer right away.I wanted to add an autocomplete to a form, but I wanted the suggestions to be local (I didn't want to make any ajax requests, I wanted to use a pre-defined javascript array).This ended up to real easy.The scenario here - I have a nested set of objects that an admin may want to give membership privileges to an existing user in their

Syndicate content