07 June 2006
This post may be outdated due to it was written on 2006. The links may be broken. The code may be not working anymore. Leave comments if needed.
DBIx::Class ++ TT sucks.

ok, assuming that we get a record like this:
my $topic = $c->model('DBIC')->resultset('Topic')->search( { topic_id => $topic_id } )->first;
$topic->{post_on} = &format_date($topic->post_on);
now TT has two [% topic.post_on %], one is $topic->{post_on}, another one is $topic->post_on.
TT will fetch the "$topic->post_on" but ingore the $topic->{post_on}.
if we need TT fetch the "$topic->{post_on}", we have two ways:
1. $topic->{_column_data}->{post_on} = &format_date($topic->post_on);
2. $topic->{post_on_date} = &format_date($topic->post_on); [% topic.post_on_date %]

javascript sucks.

IE will complain at:
var myAjax = new Ajax.Request( url, {
method: 'get',
parameters: pars,
onSuccess: showCityResponse,
onFailure: reportCityError,
} );

but Firefox will not.
The reason is "onFailure: reportCityError," chomp the last ","
"onFailure: reportCityError" will work.

It's hard to debug under IE, and Firefox has "FireBug". Thank God.

blog comments powered by Disqus