attractive, usable web applications


Richard's Blog - Design, coding and life in Japan

Richard

Ruby on Rails

Django vs Rails

 Yes it is another one of those comparison blog posts! I apologize but I had to write something about this.

Tags:

Get an array of associations for a rails model

This one got me stuck as I couldn't see any such methods in the ActiveRecord API, but with a little help from Google Ruby on Rails: Talk group I managed to work it out.

ClassName.reflect_on_all_associations.collect {|assoc| assoc.name}

Easy as that

Tags:

Testing output JSON data from a RESTful API with Cucumber

Some of the following is in Japanese so please excuse this a little, but I am setting up an Restful API in Rails that outputs JSON data, I wanted to check the multi-level JSON objects contained specific data.

Tags:

Using :include in Rails ActiveRecord call doesnt create a joins query

I am currently writing an Rails app that uses quite a few database calls. I wanted to cut these calls down so I knew I would need to use the :include option in ActiveRecord. I was expecting from what Ryan Bates mentioned in one of his RailsCasts that a nice join would be created for me in one query.

Tags:

Awesome ruby tricks..

Found this link yesterday... Awesome
21 Ruby Tricks You Should Be Using In Your Own Code

Tags:

Recent Blog Posts

Syndicate content