active/app/controllers/admin/active_signups_controller.rb

45 lines
851 B
Ruby

# encoding: utf-8
class Admin::ActiveSignupsController < OrbitAdminController
include Admin::ActivesHelper
before_action ->(module_app = @app_title) { set_variables module_app }
def initialize
super
@app_title = "active"
end
def edit
params[:controller] = "admin/actives"
@act_signup = ActSignup.find(params[:id])
@act = Act.find(@act_signup.act_id)
end
def update
@act_signup = ActSignup.find(params[:id])
@act_signup.update_attributes(act_signup_params)
redirect_to "/admin/actives/#{@act_signup.act_id}/act_signup"
end
def destroy
@act_signup = ActSignup.find(params[:id])
@act_id = @act_signup.act_id
@act_signup.destroy
redirect_to "/admin/actives/#{@act_id}/act_signup"
end
private
def act_signup_params
params.require(:act_signup).permit!
end
end