Finished User Registration

pull/35/head
rick carlino 2014-05-02 06:58:11 -07:00
parent 66f7266782
commit dd2bccc72b
7 changed files with 35 additions and 86 deletions

14
Gemfile
View File

@ -27,15 +27,15 @@ group :doc do
gem 'sdoc', require: false
end
group :development, :test do
gem 'pry'
gem 'rspec'
gem 'rspec-rails'
gem 'simplecov'
end
gem 'pry', group: [:development, :test]
gem 'haml'
gem 'capybara', group: :test
group :test do
gem 'rspec'
gem 'rspec-rails'
gem 'simplecov'
gem 'capybara'
end
gem 'devise', github: 'plataformatec/devise'

View File

@ -2,4 +2,11 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
# An overridable method for redirecting a new user to a particular page after
# registration
def after_sign_up_path_for(resource)
#doesn't seem to get called when Confirmable is active.
'dashboard/index.html'
end
end

View File

@ -38,4 +38,5 @@ class User
# The username.
field :name, type: String
validates_uniqueness_of :name
end

View File

@ -3,6 +3,9 @@
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label 'User Name' %><br />
<%= f.email_field :name %></div>
<div><%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %></div>

View File

@ -12,43 +12,32 @@
.large-6.columns
.signup-panel
%p.welcome Create your Account
%form{action: "/users", method: "post"}
= form_for(User.new, url: '/users') do |f|
.row.collapse
.small-2.columns
%span.prefix
%i.fi-torso-female
.small-10.columns
%input{placeholder: "username", type: "text"}/
= f.text_field :name, autofocus: true, placeholder: 'Pick a User Name'
.row.collapse
.small-2.columns
%span.prefix
%i.fi-mail
.small-10.columns
%input{placeholder: "email", type: "text"}/
= f.email_field :email, placeholder: 'Email'
.row.collapse
.small-2.columns
%span.prefix
%i.fi-lock
.small-10.columns
%input{placeholder: "password", type: "password"}/
= f.password_field :password, autocomplete: "off", placeholder: 'Password'
.row.collapse
.small-2.columns
%span.prefix
%i.fi-lock
.small-10.columns
%input{placeholder: "Confirm Password", type: "password"}/
%a.button
Next Step
= f.password_field :password_confirmation, autocomplete: "off", placeholder: 'Confirm Password'
= f.submit "Sign up", class: 'button'
%p
Already have an account?
%a{href: "#"} Login here »
/ = form_for :person do |f|
/ First name: #{f.text_field :first_name}
/ %br/
/ Last name : #{f.text_field :last_name}
/ %br/
/ Biography : #{f.text_area :biography}
/ %br/
/ Admin? : #{f.check_box :admin}
/ %br/
/ = f.submit
= link_to 'Login here »', new_user_session_path

View File

@ -1,61 +0,0 @@
<div class="row">
<div class="large-6 columns">
<h4>Farmbot</h4>
<!-- accordion-->
<dl class="accordion" data-accordion>
<dd>
<a href="#panel1">Genesis Tracks</a>
<div id="panel1" class="content active">
<ul>
<li>Model: Genesis Tracks</li>
<li>Lenght</li>
<li>Width</li>
<li>Height</li>
<li>Installation Date</li>
</ul>
</div>
</dd>
<dd>
<a href="#panel2">Genesis Gantry</a>
<div id="panel2" class="content">
</div>
</dd>
<dd>
<a href="#panel3">Richmond Cross-Slide</a>
<div id="panel3" class="content">
</div>
</dd>
<dd>
<a href="#panel3">Custom Tool Mount</a>
<div id="panel3" class="content">
</div>
</dd>
</dl>
<!-- /accordion-->
<h4>Tools</h4>
<h4>Sensors</h4>
</div>
<div class="large-6 columns">
<h4>Resource Usage</h4>
</div>
</div>
<div class="row">
<div class="large-6 columns">
<h4>System Information</h4>
<h4>Manual Control</h4>
</div>
<div class="large-6 columns">
<h4>Finances</h4>
</div>
</div>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello, world!</title>
</head>
<body>
<h1>Just a stub</h1>
<p>You've been logged in. Thanks for registering.</p>
</body>
</html>