Moved form helpers from application_helper to a real FormHelper

This commit is contained in:
Godwin
2014-05-12 20:09:19 -06:00
parent 9ae7135c6a
commit ffa8239e42
30 changed files with 600 additions and 357 deletions
+7 -14
View File
@@ -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