personal-conference/app/controllers/admin/conference_paper_levels_con...

41 lines
1.1 KiB
Ruby
Raw Normal View History

2014-07-01 10:19:07 +00:00
class Admin::ConferencePaperLevelsController < OrbitAdminController
def new
@paper_level = ConferencePaperLevel.new
@url = admin_conference_paper_levels_path(@paper_level)
render :layout=>false
end
def create
@paper_level = ConferencePaperLevel.new(paper_level_params)
@paper_level.save
@paper_levels = ConferencePaperLevel.all
render :partial=>'index', :layout=>false
end
def edit
@paper_level = ConferencePaperLevel.find(params[:id])
@url = admin_conference_paper_level_path(@paper_level)
render :layout=>false
end
def update
@paper_level = ConferencePaperLevel.find(params[:id])
@paper_level.update_attributes(paper_level_params)
@paper_level.save
@paper_levels = ConferencePaperLevel.all
render :partial=>'index', :layout=>false
end
def destroy
paper_level = ConferencePaperLevel.find(params[:id])
paper_level.destroy
@paper_levels = ConferencePaperLevel.all
render :partial=>'index', :layout=>false
end
private
def paper_level_params
params.require(:conference_paper_level).permit! rescue nil
end
end