forked from saurabh/personal-conference
41 lines
1.1 KiB
Ruby
41 lines
1.1 KiB
Ruby
|
class Admin::ConferencePaperTypesController < OrbitAdminController
|
||
|
def new
|
||
|
@paper_type = ConferencePaperType.new
|
||
|
@url = admin_conference_paper_types_path(@paper_type)
|
||
|
render :layout=>false
|
||
|
end
|
||
|
|
||
|
def create
|
||
|
@paper_type = ConferencePaperType.new(paper_type_params)
|
||
|
@paper_type.save
|
||
|
@paper_types = ConferencePaperType.all
|
||
|
render :partial=>'index', :layout=>false
|
||
|
end
|
||
|
|
||
|
def edit
|
||
|
@paper_type = ConferencePaperType.find(params[:id])
|
||
|
@url = admin_conference_paper_type_path(@paper_type)
|
||
|
render :layout=>false
|
||
|
end
|
||
|
|
||
|
def update
|
||
|
@paper_type = ConferencePaperType.find(params[:id])
|
||
|
@paper_type.update_attributes(paper_type_params)
|
||
|
@paper_type.save
|
||
|
@paper_types = ConferencePaperType.all
|
||
|
render :partial=>'index', :layout=>false
|
||
|
end
|
||
|
|
||
|
def destroy
|
||
|
paper_type = ConferencePaperType.find(params[:id])
|
||
|
paper_type.destroy
|
||
|
@paper_types = ConferencePaperType.all
|
||
|
render :partial=>'index', :layout=>false
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def paper_type_params
|
||
|
params.require(:conference_paper_type).permit! rescue nil
|
||
|
end
|
||
|
end
|