Sha256: b30e2b36313cb0f96365bddde4c1012bb5a26c9f4da60d561cf6fbcc6dd7972c
Contents?: true
Size: 836 Bytes
Versions: 2
Compression:
Stored size: 836 Bytes
Contents
require 'rack' class Susanoo::Application # This controller is responsible for serving/building index.html file. class Index < Susanoo::Controller def call(env) # Tilt template object template = Tilt.new(File.join(project_root, 'src/index.html.erb')) [200, {'Content-Type' => 'text/html'}, [template.render(self)]] end def build(generator, route) # Configure Sprockets::Helpers (if necessary) Sprockets::Helpers.configure do |config| config.environment = @environment config.prefix = 'assets' config.debug = false end template = Tilt.new(File.join(project_root, 'src/index.html.erb')) data = template.render(self) # God forgive me for hard coding this part generator.create_file 'www/index.html', data end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
susanoo-0.11.1 | lib/susanoo/controllers/index.rb |
susanoo-0.10.0 | lib/susanoo/controllers/index.rb |