Skip to content

Instantly share code, notes, and snippets.

Riddle.new(riddle.attributes.merge(id: nil))
- if @riddle && @riddle.id
a.button href="/edit/riddle/#{@riddle.id}" Edit this Riddle
iframe {width: 100%; min-height: 600px; border: none; }
- if @riddle
link rel="stylesheet" href="/css/riddle/#{@riddle.id}/styles.css"
script src="/js/riddle/#{@riddle.id}/script.js"
- if @riddle
link rel="stylesheet" href="/css/riddle/#{@riddle.id}/styles.css"
script src="/js/riddle/#{@riddle.id}/script.js"
Riddle.new(riddle.attributes.merge(id: nil))
- if @riddle && @riddle.id
a.button href="/edit/riddle/#{@riddle.id}" Edit this Riddle
iframe {width: 100%; min-height: 600px; border: none; }
- if @riddle
link rel="stylesheet" href="/css/riddle/#{@riddle.id}/styles.css"
script src="/js/riddle/#{@riddle.id}/script.js"
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