class Susanoo::Application::Index
This controller is responsible for serving/building index.html file.
Public Instance Methods
build(generator, options)
click to toggle source
# File lib/susanoo/controllers/index.rb, line 13 def build(generator, options) platform = options[:platform] # Configure Sprockets::Helpers (if necessary) Sprockets::Helpers.configure do |config| config.environment = @environment config.prefix = "/#{platform}_asset/www/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
call(env)
click to toggle source
# File lib/susanoo/controllers/index.rb, line 7 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