forked from saurabh/personal-journal
43 lines
1.0 KiB
Ruby
43 lines
1.0 KiB
Ruby
class Admin::JournalLevelsController < OrbitMemberController
|
|
before_action :allow_admin_only
|
|
|
|
def new
|
|
@paper_level = JournalLevel.new
|
|
@url = admin_journal_levels_path(@paper_level)
|
|
render :layout=>false
|
|
end
|
|
|
|
def create
|
|
@paper_level = JournalLevel.new(paper_level_params)
|
|
@paper_level.save
|
|
@paper_levels = JournalLevel.all
|
|
render :partial=>'index', :layout=>false
|
|
end
|
|
|
|
def edit
|
|
@paper_level = JournalLevel.find(params[:id])
|
|
@url = admin_journal_level_path(@paper_level)
|
|
render :layout=>false
|
|
end
|
|
|
|
def update
|
|
@paper_level = JournalLevel.find(params[:id])
|
|
@paper_level.update_attributes(paper_level_params)
|
|
@paper_level.save
|
|
@paper_levels = JournalLevel.all
|
|
render :partial=>'index', :layout=>false
|
|
end
|
|
|
|
def destroy
|
|
paper_level = JournalLevel.find(params[:id])
|
|
paper_level.destroy
|
|
@paper_levels = JournalLevel.all
|
|
render :partial=>'index', :layout=>false
|
|
end
|
|
|
|
private
|
|
|
|
def paper_level_params
|
|
params.require(:journal_level).permit! rescue nil
|
|
end
|
|
end |