diff options
Diffstat (limited to 'scarecrow.rb')
-rw-r--r-- | scarecrow.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scarecrow.rb b/scarecrow.rb index defc135..b1043fe 100644 --- a/scarecrow.rb +++ b/scarecrow.rb @@ -67,13 +67,13 @@ end get '/' do # send_file File.join(settings.public_folder, 'index.html') - temp_val = Temperature.last[:value] - humidity_val = Humidity.last[:value] + @temp_val = Temperature.last[:value] + @humidity_val = Humidity.last[:value] temp_time = Temperature.last[:timestamp] humidity_time = Humidity.last[:timestamp] - time_formatted = temp_time.strftime("%A, %d %b %Y %l:%M %p") - - return "#{temp_val}°C and #{humidity_val}% humidity at #{time_formatted}" + @time_formatted = temp_time.strftime("%A, %d %b %Y %l:%M %p") + erb :index + # return "#{temp_val}°C and #{humidity_val}% humidity at #{time_formatted}" end get '/temperature' do |