-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git@github.com:stcorbett/funding
- Loading branch information
Showing
12 changed files
with
156 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class UsersController < ApplicationController | ||
before_filter :require_user, :only => [:show, :edit, :update] | ||
|
||
def show | ||
@user = @current_user | ||
end | ||
|
||
def edit | ||
@user = @current_user | ||
end | ||
|
||
def update | ||
@user = @current_user # makes our views "cleaner" and more consistent | ||
if @user.update_attributes(params[:user]) | ||
flash[:notice] = "Account updated!" | ||
redirect_to account_url | ||
else | ||
render :action => :edit | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
class User < ActiveRecord::Base | ||
acts_as_authentic | ||
|
||
after_create :email_trustee_app | ||
|
||
private | ||
|
||
def email_trustee_app | ||
TrusteeMailer.deliver_trustee_app(self) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h1>Edit My Account</h1> | ||
|
||
<% form_for @user, :url => account_path do |f| %> | ||
<%= f.error_messages %> | ||
<%= f.label :email %><br /> | ||
<%= f.text_field :email %><br /> | ||
<br /> | ||
<%= f.label :password, "Change password" %><br /> | ||
<%= f.password_field :password %><br /> | ||
<br /> | ||
<%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation %><br /> | ||
|
||
<%= f.submit "Update" %> | ||
<% end %> | ||
|
||
<br /><%= link_to "My Profile", account_path %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<p> | ||
<b>email:</b> | ||
<%=h @user.email %> | ||
</p> | ||
|
||
<p> | ||
<b>Login count:</b> | ||
<%=h @user.login_count %> | ||
</p> | ||
|
||
<p> | ||
<b>Last request at:</b> | ||
<%=h @user.last_request_at %> | ||
</p> | ||
|
||
<p> | ||
<b>Last login at:</b> | ||
<%=h @user.last_login_at %> | ||
</p> | ||
|
||
<p> | ||
<b>Current login at:</b> | ||
<%=h @user.current_login_at %> | ||
</p> | ||
|
||
<p> | ||
<b>Last login ip:</b> | ||
<%=h @user.last_login_ip %> | ||
</p> | ||
|
||
<p> | ||
<b>Current login ip:</b> | ||
<%=h @user.current_login_ip %> | ||
</p> | ||
|
||
|
||
<%= link_to 'Edit', edit_account_path %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class AddNameToUser < ActiveRecord::Migration | ||
def self.up | ||
add_column :users, :name, :string | ||
end | ||
|
||
def self.down | ||
remove_column :users, :name | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class AddUrlToUser < ActiveRecord::Migration | ||
def self.up | ||
add_column :users, :url, :string | ||
end | ||
|
||
def self.down | ||
remove_column :users, :url | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AddOrganizationToUser < ActiveRecord::Migration | ||
def self.up | ||
add_column :users, :organization, :string | ||
add_column :users, :twitter, :string | ||
end | ||
|
||
def self.down | ||
remove_column :users, :twitter | ||
remove_column :users, :organization | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters