Archive for January, 2007

Using submit_tag to pass parameters

Thursday, January 25th, 2007
No Gravatar

If you want to pass a parameter through a form, you don’t pass it through submit_tag, you pass it in start_form_tag. For example, I want to pass the value of id:
<%= start_form_tag :action => ‘create’, :id => @thisparticularid %>

This is much more secure than using a hidden field, for obvious reasons!

Ruby on Rails - HABTM relationships

Wednesday, January 24th, 2007
No Gravatar

Using has_and_belongs_to_many is great if you want to manage simple HABTM assoctions, although it provides no access as far as I am aware to other attributes if present in the join table. For a more complex join, you’ve gotta code it by hand.
I came across a bug with HABTM today. Do not add an id field to the join table, if you do, the habtm join table id will be populated to contain the id of your joined model, rather than an auto-incremented number.
This inevitably leads to problems! Check out the habtm reference here for more info.

Starting Work

Wednesday, January 10th, 2007
No Gravatar

After spending the summer developing a Ruby on Rails web 2.0 community app, I needed to pay the bills so I started work in December for Armstrong International as a Web developer in Ruby on Rails

I have found a sweet flat in Bayswater, London, and will be moving in as soon as possible!


nogeek.org is Digg proof thanks to caching by WP Super Cache!