Fixed user deletion via User Admin console

This commit is contained in:
2013-01-26 02:45:47 -05:00
parent f3ef2292ae
commit f80624946c
3 changed files with 3 additions and 4 deletions

View File

@@ -1,6 +1,5 @@
class UsersController < ApplicationController class UsersController < ApplicationController
before_filter :check_for_cancel
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?

View File

@@ -28,7 +28,7 @@
<th><%= user.created_at.to_s(:datetime).downcase %></th> <th><%= user.created_at.to_s(:datetime).downcase %></th>
<th><%= user.updated_at.to_s(:datetime).downcase %></th> <th><%= user.updated_at.to_s(:datetime).downcase %></th>
<th><%= button_to "Edit", edit_user_path(user), :class => 'btn', :method => "get" %></th> <th><%= button_to "Edit", edit_user_path(user), :class => 'btn', :method => "get" %></th>
<th><%= button_to "Delete", user, :method => :delete, :confirm => "Are you sure?", :class => 'btn btn-danger', :method => "get" %></th> <th> <%= button_to "Delete", user, :action => "destroy", :confirm => "Are you sure?", :method => :delete, :class =>'btn btn-danger' %> </th>
</tr> </tr>
<% end %> <% end %>

View File

@@ -8,7 +8,7 @@
User.create!( User.create!(
[ [
{ :username => "admin", :email => "admin@forum.com", :password => "forum_admin", :password_confirmation => "forum_admin" }, { :username => "admin", :email => "admin@forum.com", :password => "forum_admin", :password_confirmation => "forum_admin", :is_admin => true },
{ :username => "user", :email => "user@forum.com", :password => "forum_user", :password_confirmation => "forum_user" } { :username => "user", :email => "user@forum.com", :password => "forum_user", :password_confirmation => "forum_user" }
] ]
) )