Proc objects in helpers

Hi, i created a little helper which accepts two Procs/lambda’s for
creating a form line which can provide “show” and “edit” functionality
(so i only need one partial). in my view i can create a form line like
this:

line(:label=>“Naam”,:show=>lambda{|r| r.name},:edit=>lambda{text_field
“organisation”, “name”,:size=>“50”})

this all works fine, but i am wondering: is this a smart thing to do?
a _form partial could contain many proc statements. can it lead to
performance problems?

regards,
remco

mmm, zero answers on my last three questions,
i am starting to feel a little insecure, am i not formulating my
questions correctly?

Remco Hh wrote:

Hi, i created a little helper which accepts two Procs/lambda’s for
creating a form line which can provide “show” and “edit” functionality
(so i only need one partial). in my view i can create a form line like
this:

line(:label=>“Naam”,:show=>lambda{|r| r.name},:edit=>lambda{text_field
“organisation”, “name”,:size=>“50”})

this all works fine, but i am wondering: is this a smart thing to do?
a _form partial could contain many proc statements. can it lead to
performance problems?

regards,
remco

On Nov 9, 2007, at 12:45 AM, Remco Hh wrote:

this all works fine, but i am wondering: is this a smart thing to do?
a _form partial could contain many proc statements. can it lead to
performance problems?

If performance is your only concern, consider benchmarking. If you
don’t plan to serve a gazillion pages, it probably won’t matter anyhow.

Just my $.02

Steve R. wrote:

On Nov 9, 2007, at 12:45 AM, Remco Hh wrote:

this all works fine, but i am wondering: is this a smart thing to do?
a _form partial could contain many proc statements. can it lead to
performance problems?

If performance is your only concern, consider benchmarking. If you
don’t plan to serve a gazillion pages, it probably won’t matter anyhow.

Just my $.02

thanks steve,
i thought of benchmarking, but i haven’t found a good method/tool for
that
i will look for it

remco