Because you are returnning the helpers as strings, values... not function
calls. remove the encapsulating double quotes so that
* html << link_to(
"image_tag(''icons/rss_#{rss[0]}.png'')", rss[1],
:disabled => "#{rss[2]}")*
will be
* html <<
link_to(image_tag(''icons/rss_#{rss[0]}.png''), rss[1],
:disabled => "#{rss[2]}")*
On Mon, Dec 20, 2010 at 6:44 AM, Me
<chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> This code outputs html to the page not the icons, ideas?
>
>
>
> def pub_social_links(pub)
> html = ""
> twit = pub.twitter.blank? ?
[''off'',"#{pub.twitter}",''disabled'']
:
> [''on'','''','''']
> rss = pub.rss.blank? ?
[''off'',"#{pub.rss}",''disabled''] :
[''on'','''']
> fb = pub.facebook.blank? ?
[''off'',"#{pub.facebook}",''disabled'']
:
> [''on'','''','''']
> html << link_to(
"image_tag(''icons/rss_#{rss[0]}.png'')", rss[1],
> :disabled => "#{rss[2]}")
> html << link_to(
"image_tag(''icons/twitter_#{twit[0]}.png'')",
> "#{twit[1]}", :disabled => "#{twit[2]}")
> html << link_to(
"image_tag(''icons/facebook_#{fb[0]}.png'')",
> "#{fb[1]}", :disabled => "#{fb[2]}")
> return html
> end
>
> <a href=""
disabled="disabled">image_tag(''icons/rss_off.png'')</a><a
href=""
>
disabled="disabled">image_tag(''icons/twitter_off.png'')</a><a
href=""
>
disabled="disabled">image_tag(''icons/facebook_off.png'')</a>
>
> --
> 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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
Mahmoud Said
Software Engineer - eSpace
blog.modsaid.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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.