forked from saurabh/orbit4-5
55 lines
1.0 KiB
Ruby
55 lines
1.0 KiB
Ruby
|
class Admin::RoleStatusesController < OrbitMemberController
|
||
|
before_action :set_role_status, only: [:show, :edit , :update, :destroy]
|
||
|
|
||
|
def index
|
||
|
@role = Role.find(params[:role_id])
|
||
|
@role_statuses = RoleStatus.where(role_id: @role.id)
|
||
|
|
||
|
respond_to do |format|
|
||
|
format.html # index.html.erb
|
||
|
format.js
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def show
|
||
|
end
|
||
|
|
||
|
def new
|
||
|
@role_status = RoleStatus.new
|
||
|
render layout: false
|
||
|
end
|
||
|
|
||
|
def create
|
||
|
@role_status = RoleStatus.new(role_status_params)
|
||
|
if @role_status.save
|
||
|
redirect_to action: :index
|
||
|
else
|
||
|
redirect_to action: :new
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def edit
|
||
|
render layout: false
|
||
|
end
|
||
|
|
||
|
def update
|
||
|
end
|
||
|
|
||
|
def toggle
|
||
|
end
|
||
|
|
||
|
def destroy
|
||
|
end
|
||
|
|
||
|
private
|
||
|
# Use callbacks to share common setup or constraints between actions.
|
||
|
def set_role_status
|
||
|
@role_status = RoleStatus.find(params[:id])
|
||
|
end
|
||
|
|
||
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||
|
def role_status_params
|
||
|
params.require(:role_status).permit!
|
||
|
end
|
||
|
end
|