diff options
author | Azul <azul@leap.se> | 2012-06-26 18:06:28 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-06-26 18:06:28 +0200 |
commit | fb5ea9059647ca8ee5cea568f47551da547b70f7 (patch) | |
tree | bbcfa1a2917228385119a57b9ddec56447d8ed7b /http-srp.rb | |
parent | 18ff58e74f9dce2531d3f68f1d2aeecada9ac73f (diff) |
stress three step layout with a little helper
Diffstat (limited to 'http-srp.rb')
-rw-r--r-- | http-srp.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/http-srp.rb b/http-srp.rb index ab1a4f4..c0c9360 100644 --- a/http-srp.rb +++ b/http-srp.rb @@ -53,3 +53,16 @@ post '/login' do @user.login!(params) redirect '/' end + +helpers do + def button_link(action, options = {}) + action = action.to_s + label = action.capitalize + klass = "btn btn-large" + if options.delete(:primary) + klass += " btn-primary" + label += " now..." + end + %Q(<a href="#{action}" class="#{klass}" id="#{action}-btn">#{label}</a>) + end +end |