you could do something like that:
file_name =
"#{Time.now.to_s}_#{params[:group_member_information].original_filename}"
but this would give you a time looking like
Wed May 07 11:26:57 +0200 2008
so using
Time.now.to_s(:db)
would look better
> but it gives error
what error?
the code would be ok, if the params[:group_member_information] would be
an uploaded file, what it most likely is not. so the error has most
likely nothing to do with the Time or the filename you generate but with
that param.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---