automation and view updates
This commit is contained in:
@@ -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