Moved form helpers from application_helper to a real FormHelper
This commit is contained in:
@@ -1,19 +1,12 @@
|
||||
= form_for @user, :html => (@user.id ? {:multipart => true} : {}) do |f|
|
||||
%div{:class => (@user.id ? 'columns medium-6' : '')}
|
||||
- if @user.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
|
||||
%ul
|
||||
- @user.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
= field f, :username, :text_field
|
||||
= field f, :email, :text_field
|
||||
= f.text_field :username
|
||||
= f.email_field :email
|
||||
- if !@user.id
|
||||
= field f, :password, :password_field
|
||||
= field f, :password_confirmation, :password_field
|
||||
= actions :register
|
||||
= f.password_field, :password
|
||||
= f.password_field, :password_confirmation
|
||||
= f.actions :register
|
||||
- if @user.id
|
||||
.columns.medium-6
|
||||
= field f, :avatar, :image_field, @user.avatar_url
|
||||
= actions :save
|
||||
= f.image_field :avatar, @user.avatar_url
|
||||
= f.actions :save
|
||||
|
||||
Reference in New Issue
Block a user