From: HUNT HUNT on
function tooltip($el,$content,$options=array()) {
if ( substr($content,0,1)!='$') $content = "'$content'";
if($options) {
return
$this->Javascript->codeBlock($this->output(sprintf($this->tooltip['fancy'],$el,$content,$this->_parseOptions($options))));
} else {
return
$this->Javascript->codeBlock($this->output(sprintf($this->tooltip['base'],$el,$content)));
}
}
--
Posted via http://www.ruby-forum.com/.

From: Jean-Julien Fleck on
2010/3/30 HUNT HUNT <aksn18july(a)gmail.com>:
> function tooltip($el,$content,$options=array()) {
>        if ( substr($content,0,1)!='$') $content = "'$content'";
>        if($options) {
>            return
> $this->Javascript->codeBlock($this->output(sprintf($this->tooltip['fancy'],$el,$content,$this->_parseOptions($options))));
>        } else {
>            return
> $this->Javascript->codeBlock($this->output(sprintf($this->tooltip['base'],$el,$content)));
>        }
>    }

My advice: try to do it yourself first and post back when you are
stuck somewhere, explaining what you've tried and what went wrong.

Hint: it should looks like

def tooltip(el,content,options=nil)
your_code_goes_here
end

Cheers,

--
JJ Fleck
PCSI1 Lycée Kléber

From: Robert Klemme on
2010/3/30 HUNT HUNT <aksn18july(a)gmail.com>:
> function tooltip($el,$content,$options=array()) {
>        if ( substr($content,0,1)!='$') $content = "'$content'";
>        if($options) {
>            return
> $this->Javascript->codeBlock($this->output(sprintf($this->tooltip['fancy'],$el,$content,$this->_parseOptions($options))));
>        } else {
>            return
> $this->Javascript->codeBlock($this->output(sprintf($this->tooltip['base'],$el,$content)));
>        }
>    }

Now that you have announced that you want to convert this PHP code to
Ruby we'll eagerly await your posting with the outcome.

Kind regards

robert


--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/