Thursday, September 13, 2007

tricky rails



here's a tricky little bug in Rails:

If you omit the :update parameter in a observe_form call, like this:


<%= observe_form 'form1',
:url => {:action=>'todo_line', :only_path => false} %>


Rails won't return the params of the form to the application with todo_line. You need to pass an empty hash for :update, like this:


<%= observe_form 'form1',
:update => {},
:url => {:action=>'todo_line', :only_path => false} %>



I got all this from the rails wiki.