Fixed user deletion via User Admin console
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
class UsersController < ApplicationController
|
||||
|
||||
before_filter :check_for_cancel
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<th><%= user.created_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 "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>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
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" }
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user