summaryrefslogtreecommitdiff
path: root/http-srp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'http-srp.rb')
-rw-r--r--http-srp.rb13
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