module IdCard class PlansController < ApplicationController # View Methods def new end def create end def edit end def update end def destroy end # API Methods 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 end end