front and back-end web development, Leeds, UK


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

Richard

Ruby on Rails

Awesome ruby tricks..

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

Tags:

JSON Data for multiple objects and associations in Rails

I am creating a REST API in Rails which outputs JSON data. In some cases I need multiple objects to be pushed out in the data, which is fine until you need to use associations in the mix also.

Example:

form = Form.find(params[:id])
products = Product.all

Tags:

Using an alias method with an abstract class model in Ruby on Rails

I was surprised about how easy and nice this solution was, I needed a separate model to manage 2 different kinds of sessions in my rails project. A regular user session and a cart specific user session. I don't know if this is the best way to organize my data but it is a legacy system that is built that way!

Tags:

Little request for Ruby on Rails

One thing that drives me mad about rails since I am not using it everyday is forms.
Although I love it to pieces why do you need 2 types of form helper (one for forms wrapped around an object and one for not). Although after a little time you find yourself remembering which is which.
But Why?
Rails is supposed to save pain which it usually does, but I find form helpers in other frameworks far easier to use as I don't have to think about these different helpers. Lets hope they fix it in Rails 3.

Tags:

Recent Blog Posts

Syndicate content