<% if request.url == 'http://www.google.com' %>
GOOGLE!
<% else %>
not google
<% end %>
That's literally what you're asking, but not sure if it's really what you want to do. You might be better off checking params[:controller] and params[:action] perhaps. Or doing a regular expression match to pick up "http://google.com" and "http://maps.google.com/q=12345+Maple+St", etc.
But... in any event, request.url will give you what the browser sees in their location bar.
> Of course that method is just a mockup, does anyone know the real
> syntax? Thanks
<% if request.url == 'http://www.google.com'%>
GOOGLE!
<% else %>
not google
<% end %>
That's literally what you're asking, but not sure if it's really what you want to do. You might be better off checking params[:controller] and params[:action] perhaps. Or doing a regular expression match to pick up "http://google.com" and "http://maps.google.com/q=12345+Maple+St", etc.
But... in any event, request.url will give you what the browser sees in their location bar.