-
Notifications
You must be signed in to change notification settings - Fork 1
/
ichzilla.rb
30 lines (26 loc) · 902 Bytes
/
ichzilla.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require "rubygems"
require 'bundler'
Bundler.require
require "sinatra"
require "erb"
helpers do
def select_tag(name, collection, *args)
options = args.last.is_a?(Hash) ? args.last : { }
options_for_select = ""
options_for_select += " class=\"#{options[:class]}\"" if options[:class]
options_for_select += " size=\"#{options[:size]}\"" if options[:size]
options_for_select += " autofocus" if options[:auto_focus]
result = "<select id=\"#{name.to_s.downcase}\" name=\"#{name.to_s}\" #{options_for_select} >\n"
collection.each do |c|
result += "<option value=\"#{c.to_s.downcase}\">#{c.to_s.capitalize}</option>\n"
end
result += "</select>\n"
end
end
get '/' do
@classes = %w(warrior defender priest cleric
enchanter sorcerer archer assassin
life shadow rune
templar attacker gunner)
erb :ichzilla
end