Well the image issue is easily corrected...use the view helper for image tags: <%=image_tag("avatar.gif", :alt => "", :style => "border: 1px solid #ddd; padding: 3px; margin: 0 10px 0 0;")%> That way I''m able to let Rails handle the application pathing just like the restful routes...and no mention of any env variable. But that won''t work for the favicon which sits in public/ so I''m still tied down to having to include that env variable in the view like that? And the question I have about the action controller relative_url_root config option...what does that do exactly and how do I use it? Or do I need to use it? My app is sitting in a subdirectory and it''s working without that settting (I''m still declaring RAILS_RELATIVE_URL_ROOT though to get the favicon working). Thanks for any help. -- 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.
On Jan 9, 10:55 pm, Lee Smith <autige...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well the image issue is easily corrected...use the view helper for > image tags: > > <%=image_tag("avatar.gif", :alt => "", :style => "border: 1px solid > #ddd; padding: 3px; margin: 0 10px 0 0;")%> > > That way I''m able to let Rails handle the application pathing just > like the restful routes...and no mention of any env variable. > > But that won''t work for the favicon which sits in public/ so I''m still > tied down to having to include that env variable in the view like > that? > > And the question I have about the action controller relative_url_root > config option...what does that do exactly and how do I use it? Or do > I need to use it? My app is sitting in a subdirectory and it''s > working without that settting (I''m still declaring > RAILS_RELATIVE_URL_ROOT though to get the favicon working). > > Thanks for any help.relative_url_root just.... refers to the app''s relative url root. It''s prepended to the path returned by in javascript_include_tag, image_tag, and such. You can access this variable in your helpers/ whatever via ActionController::Base.relative_url_root. -- 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.
Thanks pharrington. Whenever I need explicit access to the relative root, I call a helper method in my application_helper to return that config variable. That''s exactly what I needed. Thanks again. -- 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.