2011-10-18 14:47:17 +01:00
|
|
|
class PrivateUsersController < ApplicationController
|
2011-10-24 14:01:15 +01:00
|
|
|
before_filter :authenticate_user!
|
|
|
|
|
2011-10-18 14:47:17 +01:00
|
|
|
def index
|
|
|
|
@private_users = PrivateUser.where(:platform_id => params[:platform_id]).paginate :page => params[:page]
|
|
|
|
@platform = Platform.find(params[:platform_id])
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
pair = PrivateUser.generate_pair(params[:platform_id])
|
|
|
|
redirect_to platform_private_users_path(params[:platform_id]),
|
|
|
|
:notice => "Логин: #{ pair[:login] } Пароль: #{ pair[:pass] }"
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
PrivateUser.find(params[:id]).destroy
|
|
|
|
redirect_to platform_private_users_path(params[:platform_id])
|
|
|
|
end
|
2011-10-24 14:01:15 +01:00
|
|
|
end
|