Is there an easy way to determine what is the "type" of a member in the
Params hash?  The reason that I ask this question is that I have to make
adjustments for UK dates in the params hash for date and datetime
fields.

The date and datetime fields are being returned as Strings.  So when I
assign the hash to an instance variable's attributes as follows:

@entry.attributes = params[:entry]

for example.  The program errors out.  I have to Normalize the String
representation of UK dates in in US dates (still String format) before
the

    lvar = params[:entry]
    unless lvar[:example_date].nil?
      lvar[:date] = ParseDate.normalize_date(lvar[:example_date])
    end
    @entry.attributes = lvar

statement is executed and then everything works fine.  But this is a lot
of ugly duplicate coding accounting for specific members of params hash
that are date and datetime type.  I was hoping that there might be an
elegant solution to this problem.
Thanks in advance for your time.
Bharat
-- 
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to