The working basics

This commit is contained in:
Godwin
2014-03-09 14:43:33 -06:00
parent b490a97852
commit db60933506
628 changed files with 81918 additions and 1060 deletions
+19
View File
@@ -0,0 +1,19 @@
= 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
- if !@user.id
= field f, :password, :password_field
= field f, :password_confirmation, :password_field
= actions :register
- if @user.id
.columns.medium-6
= field f, :avatar, :image_field, @user.avatar_url
= actions :save
+8
View File
@@ -0,0 +1,8 @@
- banner_title @user.username
.row
= render 'form'
= link_to 'Show', @user
\|
= link_to 'Back', users_path
+22
View File
@@ -0,0 +1,22 @@
- banner_title 'Listing users'
.row
%table
%tr
%th Email
%th Crypted password
%th Salt
%th
%th
%th
- @users.each do |user|
%tr
%td= user.email
%td= user.crypted_password
%td= user.salt
%td= link_to 'Show', user
%td= link_to 'Edit', edit_user_path(user)
%td= link_to 'Destroy', user, :method => :delete, :data => { :confirm => 'Are you sure?' }
= link_to 'New User', new_user_path
+6
View File
@@ -0,0 +1,6 @@
- banner_title 'Create an Account'
.row
= render 'form'
= link_to 'Back', users_path
+14
View File
@@ -0,0 +1,14 @@
- banner_title @user.username
%p#notice= notice
.row
%p
%b Email:
= @user.email
= image_tag(@user.avatar_url(:thumb)) if @user.avatar?
= link_to 'Edit', edit_user_path(@user)
\|
= link_to 'Back', users_path