-
-
Save ylluminarious/f5ed3741d08528d87d26 to your computer and use it in GitHub Desktop.
example of requiring problem with volt
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
# 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' |
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> | |
<:Body> | |
<div id="example"></div> | |
<:examples /> | |
<div id="example_code"></div> |
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 | |
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 |
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
# 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