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.
thanks,
rich
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.
thanks,
rich
On Thursday 17 November 2005 22:05, Rich B. 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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs