Created
July 3, 2015 03:51
-
-
Save kitlangton/2b537ff4c6ded45501e4 to your computer and use it in GitHub Desktop.
This file contains 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
module Main | |
class BoxesController < Volt::ModelController | |
model :store | |
def create_box | |
boxes << Box.new(width: 100, height: 100) | |
end | |
def delete_boxes | |
boxes.reverse.map(&:destroy) | |
end | |
end | |
end |
This file contains 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> | |
boxes index | |
<:Body> | |
<h1>Boxes</h1> | |
<button e-click="create_box">Create Box</button> | |
<button e-click="delete_boxes">Delete Boxes</button> | |
<div class="boxes-container"> | |
{{ _boxes.each do |box| }} | |
<:box model="{{ box }}"> | |
{{ end }} | |
</div> | |
<:Box> | |
<div class="box"> | |
Box | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment