diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 796ac9f..77b9b86 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -93,10 +93,4 @@ class UsersController < ApplicationController redirect_to root_path end end - - def check_for_cancel - if params[:commit] == 'cancel' - redirect_to :back - end - end end diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index fd5181b..e28f615 100755 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,24 +1,30 @@ -
<%= f.label :email %> - <%= f.email_field :email %>
+<%= f.label :email %> + <%= f.email_field :email %>
-<%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password %>
<%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password %>
<%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation %>
+<%= f.label :password_confirmation %> + <%= f.password_field :password_confirmation %>
-<%= f.label :current_password %> (we need your current password to confirm your changes)
- <%= f.password_field :current_password %>
<%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password %>
- <%= f.submit "Update", :class=> 'btn btn-primary'%> <%= button_tag "Cancel", :confirm => 'Are you sure? Any changes will be lost.', :class => 'btn', :type => 'submit', :name => 'commit', :value => 'cancel' %> -
-<% end %> ++ <%= f.submit "Update", :class=> 'btn btn-primary'%> <%= button_tag "Cancel", :confirm => 'Are you sure? Any changes will be lost.', :class => 'btn', :type => 'submit', :name => 'commit', :value => 'cancel' %> +
+ <% end %> -<%= f.label :username %>
- <%= f.text_field :username %>
<%= f.label :is_admin %> - <%= f.check_box :is_admin, {checked: @user.admin?} %>
+ <%= f.label :username %> + <%= f.text_field :username %> + ++ Administrator <%= f.check_box :is_admin, {checked: @user.admin?} %> +
-<%= f.label :email %>
- <%= f.email_field :email %>
<%= f.label :password, "New password" %>
- <%= f.password_field :password %>
<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation %>
<%= f.label :password, "New password" %>
- <%= f.password_field :password %>
<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation %>
| Username | -Login Count | -Last Sign In | -Admin | -Created At | -Last Edited | +Username | +Email + | Login Count | +Last Sign In | +Admin | +Created At | +Last Edited | <%= user.admin? %> | <%= user.created_at.to_s(:datetime).downcase %> | <%= user.updated_at.to_s(:datetime).downcase %> | -<%= link_to "Edit", edit_user_path(user) %> | -<%= link_to "Delete", user, :method => :delete, :confirm => "Are you sure?" %> | +<%= button_to "Edit", edit_user_path(user), :class => 'btn', :method => "get" %> | +<%= button_to "Delete", user, :method => :delete, :confirm => "Are you sure?", :class => 'btn btn-danger', :method => "get" %> | <% end %>
|---|
<%= link_to "New User", new_user_path %>
+<%= button_to "New User", new_user_path, :class => 'btn btn-primary', :method => "get" %>
<%= @user.username %>
+<%= @user.username %>
<%= @user.email %>
diff --git a/config/routes.rb b/config/routes.rb index 0952caf..0fcbe8c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,8 @@ Community::Application.routes.draw do root :to => 'categories#index', :via => :get end - devise_for :users + devise_for :users, :controllers => {:registrations => "registrations"} + scope "/admin" do resources :users end