Skip to content

Instantly share code, notes, and snippets.

@ylluminarious
Last active August 29, 2015 14:23
Show Gist options
  • Save ylluminarious/f5ed3741d08528d87d26 to your computer and use it in GitHub Desktop.
Save ylluminarious/f5ed3741d08528d87d26 to your computer and use it in GitHub Desktop.
example of requiring problem with volt
# Specify which components you wish to include when
# the "home" component loads.
# bootstrap css framework
component 'bootstrap'
# a default theme for the bootstrap framework
component 'bootstrap_jumbotron_theme'
# provides templates for login, signup, and logout
component 'user_templates'
component 'examples'
<:Title>
<:Body>
<div id="example"></div>
<:examples />
<div id="example_code"></div>
module Main
require 'opal-phaser'
puts "test" # ^ that only gets called once, since this line gets printed out once
class ExamplesController < Volt::ModelController
model :page
def index
end
def template
page._example = params._example
end
end
end
# See https://github.com/voltrb/volt#routes for more info on routes
client '/', controller: 'main'
client '/examples', controller: 'examples', action: 'index'
client '/examples/{{ category }}/{{ example }}', controller: 'examples', action: 'template'
# Routes for login and signup, provided by user_templates component gem
#client '/signup', component: 'user_templates', controller: 'signup'
#client '/login', component: 'user_templates', controller: 'login'
# The main route, this should be last. It will match any params not
# previously matched.
client '/', {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment