I have an table with a background image but I do not know how to load the image. In general I use a code line like "<td height="50" background="../images/5.png">" but this do not work, because the directory changes, for example if I open a sub page of my controller, the picture is gone. Please just tell me how to use the image_tag with the background tag in html. Regrades Snoop1990 -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Image tag generates <img src=> i''m pretty sure. Why are you doing ../? Just make it / On Feb 14, 3:54 pm, Snoop1990 Snoop1990 <rails-mailing-l...@andreas- s.net> wrote:> I have an table with a background image but I do not know how to load > the image. > > In general I use a code line like > "<td height="50" background="../images/5.png">" > but this do not work, because the directory changes, for example if I > open a sub page of my controller, the picture is gone. Please just tell > me how to use the image_tag with the background tag in html. > > Regrades Snoop1990 > -- > Posted viahttp://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I have an table with a background image but I do not know how to load > the image. > > In general I use a code line like > "<td height="50" background="../images/5.png">" > but this do not work, because the directory changes, for example if I > open a sub page of my controller, the picture is gone. Please just tell > me how to use the image_tag with the background tag in html.image_path("edit.png") # => /images/edit.png image_path("icons/edit.png") # => /images/icons/edit.png image_path("/icons/edit.png") # => /icons/edit.png --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom wrote:> image_path("edit.png") # => /images/edit.png > image_path("icons/edit.png") # => /images/icons/edit.png > image_path("/icons/edit.png") # => /icons/edit.pngI tried <td height="150" background=" <=%image_path("1.png")%> "> but it does not work ! How to tell ruby on rails it should render the command when using it inside a html command ? -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
<td height="150" background=" <=%image_path("1.png")%> "> Well, it''s supposed to be <%=, but that was probably a typo. On Feb 14, 4:27 pm, Snoop1990 Snoop1990 <rails-mailing-l...@andreas- s.net> wrote:> Philip Hallstrom wrote: > > image_path("edit.png") # => /images/edit.png > > image_path("icons/edit.png") # => /images/icons/edit.png > > image_path("/icons/edit.png") # => /icons/edit.png > > I tried <td height="150" background=" <=%image_path("1.png")%> "> > but it does not work ! How to tell ruby on rails it should render the > command when using it inside a html command ? > -- > Posted viahttp://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
From your example, it looks like you''ve got double quotes (") nested inside other double quotes. Have you tried: <td height="150" background=" <=%image_path(''1.png'')%> "> -Steve On Feb 14, 2:45 pm, kopf1988 <kopf1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <td height="150" background=" <=%image_path("1.png")%> "> > > Well, it''s supposed to be <%=, but that was probably a typo. > > On Feb 14, 4:27 pm, Snoop1990 Snoop1990 <rails-mailing-l...@andreas- > > s.net> wrote: > > Philip Hallstrom wrote: > > > image_path("edit.png") # => /images/edit.png > > > image_path("icons/edit.png") # => /images/icons/edit.png > > > image_path("/icons/edit.png") # => /icons/edit.png > > > I tried <td height="150" background=" <=%image_path("1.png")%> "> > > but it does not work ! How to tell ruby on rails it should render the > > command when using it inside a html command ? > > -- > > Posted viahttp://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Steve wrote:> From your example, it looks like you''ve got double quotes (") nested > inside other double quotes. > > Have you tried: > > <td height="150" background=" <=%image_path(''1.png'')%> "> > > -SteveThank you very much, it is all working now ! Regrades Snoop1990 -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---