First of all params incoming with the requests are strings. You expect
to be Fixnum (0), rather than a String (‘0’). params[:anything] cannot
== 0, because if it is “zero”, it will be received as “0” in the
controller. Just use this in the conditional and report with whether it
succeeded or is still failing, in which case I’d ask you to provide
action of the same controller, and before filters that affect
action (replaced 0 with ‘0’):
Device.find_by_id( params[:device_id] ).driver = (
params[:driver_id] == ‘0’ ) ? nil : Driver.find_by_id(
2012/8/1 Ajit T. [email protected]
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
For more options, visit https://groups.google.com/groups/opt_out.