Sha256: 49c22caaff119664775b1aeafd1137fa06530c281c2221ace6c3925279a3d869
Contents?: true
Size: 1.23 KB
Versions: 1
Compression:
Stored size: 1.23 KB
Contents
require 'sinatra/base' require 'sinatra/assetpack' require 'erector' require 'active_support/all' require 'dvl/flashes' class App < Sinatra::Base set :root, File.dirname(__FILE__) register Sinatra::AssetPack assets do serve '/js', from: '../vendor/assets/javascripts' serve '/css', from: '../vendor/assets/stylesheets' end get '/' do Erector.inline { rawtext '<!doctype html>' html { head { link href: '/css/dvl/flashes.css', rel: 'stylesheet', type: 'text/css', media: 'all' } body { # Uncomment to test rendering from existing HTML # widget Dvl::Flashes::Views::Flashes.new(flash: { success: 'You did it!' }) ul { li { a 'Success', href: 'javascript:DvlFlash("success", "You did it!")' } li { a 'Info', href: 'javascript:DvlFlash("info", "An informational message...")' } li { a 'Error', href: 'javascript:DvlFlash("error", "Oh no, an error occured!")' } } script src: '//code.jquery.com/jquery-1.11.1.min.js' script src: '/js/dvl/flashes.js' } } }.to_html end run! if app_file == $0 end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dvl-flashes-0.0.1 | preview/app.rb |