Skip to content

Commit

Permalink
No need for users controller anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Feb 8, 2010
1 parent 172d69c commit 18245d9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 67 deletions.
26 changes: 0 additions & 26 deletions app/controllers/users_controller.rb

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/home/index.html.erb
@@ -1,8 +1,12 @@
<h1>Hello!</h1> <h1>Hello!</h1>

<% unless admin_signed_in? -%> <% unless admin_signed_in? -%>
<p><%= link_to 'Sign up as Admin', new_admin_registration_path %></p>
<p><%= link_to 'Sign in as Admin', new_admin_session_path %></p> <p><%= link_to 'Sign in as Admin', new_admin_session_path %></p>
<% end -%> <% end -%>
<% unless user_signed_in? -%> <% unless user_signed_in? -%>
<p><%= link_to 'Sign up as User', new_user_registration_path %></p>
<p><%= link_to 'Sign in as User', new_user_session_path %></p> <p><%= link_to 'Sign in as User', new_user_session_path %></p>
<% end -%> <% end -%>


Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Expand Up @@ -17,7 +17,7 @@
<% if user_signed_in? -%> <% if user_signed_in? -%>
<div id="user_login_box" style="float:right"> <div id="user_login_box" style="float:right">
<%= current_user.email %> | <%= current_user.email %> |
<%= link_to 'My info', edit_user_path %> | <%= link_to 'My info', edit_user_registration_path %> |
<%= link_to 'Sign out', destroy_user_session_path %> <%= link_to 'Sign out', destroy_user_session_path %>
</div> </div>
<% end -%> <% end -%>
Expand Down
32 changes: 0 additions & 32 deletions app/views/users/edit.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion config/routes.rb
Expand Up @@ -2,7 +2,6 @@
map.devise_for :users, :admin map.devise_for :users, :admin


map.resources :home, :only => :index map.resources :home, :only => :index
map.resource :user
map.resources :admins, :only => [:index] map.resources :admins, :only => [:index]


map.root :controller => :home map.root :controller => :home
Expand Down
14 changes: 7 additions & 7 deletions db/schema.rb
Expand Up @@ -12,17 +12,17 @@
ActiveRecord::Schema.define(:version => 20091009223419) do ActiveRecord::Schema.define(:version => 20091009223419) do


create_table "admins", :force => true do |t| create_table "admins", :force => true do |t|
t.string "email", :limit => 100, :null => false t.string "email", :null => false
t.string "encrypted_password", :limit => 40, :null => false t.string "encrypted_password", :limit => 40, :null => false
t.string "password_salt", :limit => 20, :null => false t.string "password_salt", :null => false
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
end end


create_table "users", :force => true do |t| create_table "users", :force => true do |t|
t.string "email", :limit => 100, :null => false t.string "email", :null => false
t.string "encrypted_password", :limit => 40, :null => false t.string "encrypted_password", :limit => 40, :null => false
t.string "password_salt", :limit => 20, :null => false t.string "password_salt", :null => false
t.string "confirmation_token", :limit => 20 t.string "confirmation_token", :limit => 20
t.datetime "confirmed_at" t.datetime "confirmed_at"
t.datetime "confirmation_sent_at" t.datetime "confirmation_sent_at"
Expand All @@ -34,7 +34,7 @@
t.datetime "last_sign_in_at" t.datetime "last_sign_in_at"
t.string "current_sign_in_ip" t.string "current_sign_in_ip"
t.string "last_sign_in_ip" t.string "last_sign_in_ip"
t.integer "failed_attempts", :default => 0 t.integer "failed_attempts", :default => 0
t.string "unlock_token", :limit => 20 t.string "unlock_token", :limit => 20
t.datetime "locked_at" t.datetime "locked_at"
t.datetime "created_at" t.datetime "created_at"
Expand Down

0 comments on commit 18245d9

Please sign in to comment.