christopher,
You can get the subdomain from the request object in the context of a
controller (or a view) like this:
<%= image_tag logos/#{request.subdomains.first}.gif %>
What is @site ? Do you define it somewhere? If so then you can assign
the subdomain in your controller like this, provided @site is a hash,
or an object with a subdomain attribute.
@site.subdomain = request.subdomains.first
I would suggest in application.rb, so that it is available to all
your controllers.
-christos
On 17 Feb 2007, at 19:12, christopher wrote:
>
> ok, forgive my ignorance as a peer is trying to use subdomain specific
> logos for each subdomain site that we are implementing...
>
> we''re frustrated because @site.subdomain should return the
subdomain
> used for each subdomain. You just need something unique for each site,
> then do stuff like:
> <%= image_tag logos/#{@site.subdomain}.gif %>
>
> to create for example
> <img src=/images/logos/prod.gif />
>
> on the prod site.
>
> we are using <%= image_tag "logos/#{@site.subdomain}.png"
%> and we
> can see the header image but no logo image... the code is outputting
> nothing at all, not even an incorrect image tag. we originally tried
> using the variable to call divs rather than images, but that had the
> same no output problem, then we moved back to just an image call,
> still
> no luck.
>
> Thoughts?
>
> --
> 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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---