Handle our URL root path when in production vs. local testing

This commit is contained in:
R. Tyler Croy 2017-09-03 16:32:02 -07:00
parent c8a8d2c1b5
commit d9d9a843ca
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
:ruby
@url_root = '/'
if ENV['RACK_ENV'] == 'production'
@url_root = '/canary/'
end
!!! XML
!!!
%html
@ -21,8 +27,8 @@
Code Valet - Canary
%body
%nav.navbar.navbar-inverse.bg-warning.navbar-toggleable
%a.navbar-brand{:href => '/canary/'}
%img{:src => 'images/songbird-128.png',
%a.navbar-brand{:href => @url_root}
%img{:src => "#{@url_root}images/songbird-128.png",
:width => '50', :height => '50', :alt => 'Grace the Canary in the Code Mine'}/
Canary
.navbar-collapse

View File

@ -3,7 +3,7 @@
.col-md-12
%h2
Meet Canary
%img{:src => 'images/songbird-128.png',
%img{:src => "#{@url_root}images/songbird-128.png",
:title => 'Grace the Canary in the Code Mine',
:align => :right}
%p