This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - if @riddle | |
| link rel="stylesheet" href="/css/riddle/#{@riddle.id}/styles.css" | |
| script src="/js/riddle/#{@riddle.id}/script.js" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/css/riddle/:id/styles.css' do | |
| riddle = Riddle.get(params[:id]) | |
| scss "#riddle #{riddle.css}" | |
| end | |
| get '/js/riddle/:id/script.js' do | |
| riddle = Riddle.get(params[:id]) | |
| content_type 'text/javascript' | |
| render :str, riddle.js, :layout => false | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@riddle | |
| doctype html | |
| html lang="en" | |
| head | |
| title== @riddle.title | |
| meta charset="utf-8" | |
| style | |
| == scss @riddle.css | |
| script | |
| == @riddle.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/:id' do | |
| @riddle = Riddle.get(params[:id]) | |
| slim :riddle, layout: false | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@show | |
| h1.title== @riddle.title | |
| #riddle | |
| iframe src="/#{@riddle.id}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra' | |
| require 'sass' | |
| require 'slim' | |
| get('/css/styles.css'){ scss :styles } | |
| get '/' do | |
| slim :index | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/finish' do | |
| flash.now[:message] = "Thank you for shopping at Flash Farm, please come baaa-ck soon!" | |
| slim :index | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/discount' do | |
| # discount logic goes here | |
| flash.keep | |
| flash[:info] = "A discount of 10% was applied to your order" | |
| redirect to('/finish') | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/finish' do | |
| flash[:message] = "Thank you for shopping at Flash Farm, please come baaa-ck soon!" | |
| slim :index | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/discount' do | |
| # discount logic goes here | |
| flash[:info] = "A discount of 10% was applied to your order" | |
| redirect to('/finish') | |
| end |