Hi there,

I'm kind of a newbie on RoR and on this group and I was wondering if
someone could help to clean this bit of code:

<%= link_to_remote (image_tag("hide.png", :size=>"16x16"),
                                                
:url=>"/message/#{message.id}/hide",
                                                :method=>"post",
                                                
:before=>"Effect.Fade(this.parentNode.parentNode, {duration:
0.5});
                                                                
Effect.BlindUp(this.parentNode.parentNode, {duration: 0.5})")
%>
<%= link_to_remote (image_tag("top.png", :size=>"16x16"),
                                                
:url=>"/message/#{message.id}/top",
                                                :method=>"post",
                                                
:before=>"Effect.Fade(this.parentNode.parentNode, {duration:
0.5});
                                                                
Effect.BlindUp(this.parentNode.parentNode, {duration: 0.5})")
%>
<%= link_to_remote (image_tag("bottom.png", :size=>"16x16"),
                                                
:url=>"/message/#{message.id}/bottom",
                                                :method=>"post",
                                                
:before=>"Effect.Fade(this.parentNode.parentNode, {duration:
0.5});
                                                                
Effect.BlindUp(this.parentNode.parentNode, {duration: 0.5})")
%>

As you can see I have some kind of options that do repeat themselves.
My idea was to find a way to describe them for once and use them
repeatedly.
Any thoughts on how to achieve this,

Thanks in advance,

Christophe

-- 
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