Created
December 7, 2014 01:19
-
-
Save johnwahba/12411559d01cff59168a to your computer and use it in GitHub Desktop.
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
<:Title> | |
New Poll | |
<:Body> | |
<h1>New Poll</h1> | |
<form> | |
<h3>Question</h3> | |
<input type="text" value="{{ page._todo._question }}"> | |
{{ page._todo._answers.each do |answer| }} | |
<div><input type="text" value="{{ answer._text }}"></div> | |
{{ end }} | |
<div><button e-click="add_an_answer('')">Add an answer</button></div> | |
</form> |
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
class PollsController < Volt::ModelController | |
def create_poll | |
end | |
def add_an_answer(answer) | |
page._todo._answers << {text: answer} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment