diff options
author | elijah <elijah@riseup.net> | 2013-07-02 23:17:44 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-07-04 04:12:59 -0700 |
commit | fa7b7425e7c53282472c1c9ce1cdc7272f55cfd4 (patch) | |
tree | e5e1be6d8b273344e5297c2c97b9638ef66e8ba8 /users/app/helpers | |
parent | e996432cbd50f4dadaae0ff62ac3f286ab125b1f (diff) |
users engine changes - rewrite of the views, separate email settings to a separate controller, make users_controller html only and v1/users_controller json only.
Diffstat (limited to 'users/app/helpers')
-rw-r--r-- | users/app/helpers/users_helper.rb | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/users/app/helpers/users_helper.rb b/users/app/helpers/users_helper.rb index 559b3f7..f56faab 100644 --- a/users/app/helpers/users_helper.rb +++ b/users/app/helpers/users_helper.rb @@ -1,39 +1,7 @@ module UsersHelper - def user_form_with(partial, options = {}) - user_form(options) do |f| - options[:f] = f - render :partial => partial, - :layout => 'legend_and_submit', - :locals => options - end - end - - def user_form(options = {}) - simple_form_for @user, - :html => user_form_html_options(options), - :validate => true do |f| - yield f - end - end - - def user_form_html_options(options) - { :class => user_form_html_classes(options).join(" "), - :id => dom_id(@user, options[:legend]) - } - end - - def user_form_html_classes(options) - classes = %W/user form/ - classes << options[:legend] - classes << (@user.new_record? ? 'new' : 'edit') - classes.compact - end - - def user_field(field) - value = @user.send(field) - value = value.to_s(:long) if field.end_with? '_at' - value || 'not set' + def user_form_class(*classes) + (classes + ['user', 'form', (@user.new_record? ? 'new' : 'edit')]).compact.join(' ') end def wrapped(item, options = {}) |