class Panel::Ask::BackEnd::AskAdminsController < OrbitBackendController

  include AdminHelper
  include OrbitControllerLib::DivisionForDisable

  before_filter :for_app_manager

  def initialize
    super
    @app_title = 'ask_admins'
  end

  def index
    @ask_admins = AskAdmin.all
    @ask_admin = AskAdmin.new
    @url = panel_ask_back_end_ask_admins_path
  end

  def create
    @ask_admin = AskAdmin.new(params[:ask_admin])
    @ask_admin.save

    respond_to do |format|
      format.js
    end
  end

  def edit
    @ask_admin = AskAdmin.find(params[:id])
    @url = panel_ask_back_end_ask_admin_path(@ask_admin)

    respond_to do |format|
      format.js
    end
  end

  def update
    @ask_admin = AskAdmin.find(params[:id])
    @url = panel_ask_back_end_ask_admin_path(@ask_admin)
    @ask_admin.update_attributes(params[:ask_admin])

    respond_to do |format|
      format.js
    end
  end

  def destroy
    @ask_admin = AskAdmin.find(params[:id])
    @ask_admin.destroy

    respond_to do |format|
      format.js
    end
  end

end
