summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-08 11:49:14 +0200
committerAzul <azul@leap.se>2014-04-08 11:49:14 +0200
commitb6d14dc19dd350a807826e3e097738a36613e083 (patch)
tree093dc5f2f1e773e3ad009d28d1fd24667d3c0ba6 /app/helpers
parent2e11e3ca2c7b02fdb5ff54f0bcd766cc5fa39975 (diff)
moving users: app and test files
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/.gitkeep0
-rw-r--r--app/helpers/email_aliases_helper.rb11
-rw-r--r--app/helpers/sessions_helper.rb2
-rw-r--r--app/helpers/users_helper.rb14
4 files changed, 27 insertions, 0 deletions
diff --git a/app/helpers/.gitkeep b/app/helpers/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/helpers/.gitkeep
diff --git a/app/helpers/email_aliases_helper.rb b/app/helpers/email_aliases_helper.rb
new file mode 100644
index 0000000..b56b068
--- /dev/null
+++ b/app/helpers/email_aliases_helper.rb
@@ -0,0 +1,11 @@
+module EmailAliasesHelper
+
+ def email_alias_form(options = {})
+ simple_form_for [@user, EmailAlias.new()],
+ :html => {:class => "form-horizontal email-alias form"},
+ :validate => true do |f|
+ yield f
+ end
+ end
+
+end
diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb
new file mode 100644
index 0000000..309f8b2
--- /dev/null
+++ b/app/helpers/sessions_helper.rb
@@ -0,0 +1,2 @@
+module SessionsHelper
+end
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
new file mode 100644
index 0000000..f56faab
--- /dev/null
+++ b/app/helpers/users_helper.rb
@@ -0,0 +1,14 @@
+module UsersHelper
+
+ def user_form_class(*classes)
+ (classes + ['user', 'form', (@user.new_record? ? 'new' : 'edit')]).compact.join(' ')
+ end
+
+ def wrapped(item, options = {})
+ options[:as] ||= :div
+ content_tag options[:as], :class => dom_class(item), :id => dom_id(item) do
+ yield
+ end
+ end
+
+end