On 19 December 2010 04:05, Walter Lee Davis <[email protected]> wrote:
>> You could use current_page? ; however, in your case, I'd probably simply
>> declare a different layout for the home page.
>
> Hmmm. That seems like a lot of duplication, since the only thing I want to
> change is the name of the logo file.

Hardly lots... and you could DRY it...

Alternatively, what about storing the logo filename in settings? (I'd
recommend SettingsLogic). And then updating/overwriting the value in
the home controller - similar to your own solution, but a bit more
decipherable for The Next Developer (or you in six months :-)

Or... if you really want to evaluate on every page, you can access
@controller and the action name in the view - create a helper that
compares it to the root_url to display whichever image you wish - this
StackOverflow post might help if that's the approach you want to take:
http://stackoverflow.com/questions/960041/get-matching-route-from-url-in-rails-again

> Google has been unhelpful, probably because the words in my question are too
> general.

Also, possibly, because you problem has so many possible solutions,
and none of them "the right one"... just pick one that's least smelly
;-)

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