Tag Archives: Ruby On Rails

Recursive custom to_json in Ruby for arrays of objects or nested objects

Let’s say we want to customize the json template for an object: class User def to_json super(:except => [:password, :password_salt, :encrypted_password, :last_sign_in_ip, :updated_at, :current_sign_in_ip, :remember_token, :reset_password_token, :remember_created_at]) end end Apparently this is fixed in Ruby 1.9 but for now only converting an object [...]
Posted in Software | Also tagged , , , , | Comments closed

Deduping join data in ruby based on multiple attributes

In the past I created an app using Rails built in HABTM and no unique index on the join tables. I’m more into the has_many :through choice today. In order to migrate my data with a unqiue index, I had a bunch of de-duping to do. It was a bit trickier than [...]
Posted in Software | Also tagged , , , , | Comments closed

Rails Authentication with Devise and CanCan part 2 – Restful Resources for Administrators

About two months ago I wrote an article on getting started with Devise and CanCan. Since then, I’ve implemented the Devise + CanCan combo on three projects and wrote a couple specs for Ryan Bates to help improve CanCan functionality. This article will focus more on Devise with some CanCan sprinkled in there. [...]
Posted in Software | Also tagged , , , , , , , , | Comments closed

Better Human Race

Better Human Race is the easiest way to raise money for charity. Search with Yahoo, Shop with Amazon, Connect with Facebook, and use our toolbar. I am co-founder and currently the developer of all Better Human Race technology.
Posted in portfolio | Also tagged , , , , , , , , , , | Comments closed

Rails Authentication with Devise and CanCan – Customizing Devise Controllers

I’m tired of spending loads of time creating user authentication systems with permissions or swimming against the current to customize what’s available. There’s great open source stuff out there but until now, I haven’t gotten the full package with really easy customization. The Devise and CanCan combo for user authentication and permissions in Rails is my [...]
Posted in Software | Also tagged , , , , , , | Comments closed

Country Seed Data for your Rails App

Never go looking for basic country seed data again: [ { :name => 'Afghanistan', :iso_two_letter_code => 'AF' }, { :name => 'Aland Islands', :iso_two_letter_code => 'AX' }, { :name => 'Albania', :iso_two_letter_code => 'AL' }, { :name => 'Algeria', :iso_two_letter_code => 'DZ' }, { :name => 'American Samoa', :iso_two_letter_code => 'AS' [...]
Posted in Software | Also tagged , , | Comments closed

Scaling a Rails Application – Thinking About the Full Stack

I found a great presentation about scaling web applications that I wanted to share with the world. Enjoy! Scaling a Rails Application from the Bottom Up If you enjoyed this post, make sure you subscribe to my RSS feed!
Posted in Software | Also tagged , , | Comments closed

Getting FancyUpload to work with Rails

FancyUpload is a slick looking file uploader with a progress bar. However, it’s not completely obvious how to get it working with your Rails application. I searched long and hard and found 2 pretty good examples here and here. The problem is that the former only works with Amazon S3, and the [...]
Posted in Software | Also tagged , , , , | Comments closed

B’more on Rails synopsis – April 2010

B’more on Rails is a community of Baltimore folks who use the Ruby programming language and the Ruby on Rails application framework. Check out our MeetUp page. Below is a brief synopsis from our April 2010 meetup. You can also download the slides here. Bundler is great for gem management. Among other [...]
Posted in Bmore On Rails Review, Software | Also tagged , , , , , , , , , , | Comments closed

Ruby on Rails – Skipping validations based on where object is created

I ran into an issue today where I wanted to skip validations based on where an object was created. To be more specific, I wanted to validate strictly if a “venue” was created through my web interface but I want to skip validations when importing venues. The reasoning is pretty simple, I want [...]
Posted in Software | Also tagged , , , | Comments closed