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
@@new | |
form action="/riddle" method="POST" | |
label for="title" Title | |
input#title name="riddle[title]" value="#{@riddle.title}" | |
label for="html" HTML | |
textarea#html cols=60 rows=10 name="riddle[html]"[email protected] | |
label for="css" CSS | |
textarea#css cols=60 rows=10 name="riddle[css]"[email protected] | |
label for="js" JS | |
textarea#js cols=60 rows=10 name="riddle[js]"[email protected] |
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 '/edit/riddle/:id' do | |
riddle = Riddle.get(params[:id]) | |
@riddle = Riddle.new(riddle.attributes.merge(id: nil)) | |
slim :new | |
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.new(riddle.attributes.merge(id: nil)) |
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 && @riddle.id | |
a.button href="/edit/riddle/#{@riddle.id}" Edit this Riddle |
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
iframe {width: 100%; min-height: 600px; border: none; } |
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
- 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
Riddle.new(riddle.attributes.merge(id: nil)) |
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 && @riddle.id | |
a.button href="/edit/riddle/#{@riddle.id}" Edit this Riddle |
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
iframe {width: 100%; min-height: 600px; border: none; } |