automation and view updates
This commit is contained in:
@@ -2,7 +2,12 @@ class EmployersController < ApplicationController
|
||||
|
||||
# View Methods
|
||||
def index
|
||||
@employers = Employer.all
|
||||
@not_automation_ready = Employer.not_automation_ready
|
||||
@missing_keychain_initialization = Employer.missing_keychain_initialization
|
||||
@missing_plans_initialization = Employer.missing_plans_initialization
|
||||
@missing_members_initialization = Employer.missing_members_initialization
|
||||
@active_with_active_id_card_setup = Employer.active_with_active_id_card_setup
|
||||
@deactivated = Employer.deactivated
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -24,9 +24,14 @@ module IdCard
|
||||
|
||||
# API Methods
|
||||
|
||||
def get_plan_benefits
|
||||
@plan_benefits = IdCard::Plan.find(params[:id]).plan_benefits
|
||||
render json: @plan_benefits.as_json
|
||||
def get_plan_template
|
||||
@template_plan = IdCard::Plan.includes(:plan_benefits).find_by(id: params[:id], template: true)
|
||||
render json: @template_plan.as_json(
|
||||
only: [:title],
|
||||
include: {
|
||||
plan_benefits: { except: [:id, :plan_id, :created_at, :updated_at] }
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -87,6 +87,17 @@ module IdCard
|
||||
|
||||
end
|
||||
|
||||
def update_active_status
|
||||
@setup.active = !@setup.active
|
||||
if @setup.save
|
||||
puts "sucess"
|
||||
redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Active Status successfully updated.'
|
||||
else
|
||||
puts "fail"
|
||||
render :show, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
# @resource = Resource.find(params[:id])
|
||||
# @resource.destroy
|
||||
|
||||
Reference in New Issue
Block a user