On Thursday 17 November 2005 22:05, Rich Brant wrote:> would anyone be willing to provide a code sample demonstrating how
> to override form field data, or simply the best way and place to
> access it before action is taken on it? A link to an example would
> be great as well.
If I understood what you meant correctly, then something like this
should work:
class MyController < ApplicationController
before_filter :convert_timezone, :only => [ :create ]
def create
# here @params[:timezone] is already an instance of TimeZone
end
def convert_timezone
return unless @params[:timezone]
@params[:timezone] = TimeZone.new(@params[:timezone])
end
end
Hope that helps>
> thanks,
> rich
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
--
Dmitry V. Sabanin
http://sabanin.ru