1 class WritingFormatsController < ApplicationController
2 if Manifest.manifest.magic_numbers['run_mode'] == 0
3 before_filter :authenticate_user, :only => []
5 before_filter :authenticate_reader, :only => [:index, :show, :count]
6 before_filter :authenticate_user, :only => []
8 before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
18 def show_html_format format
25 respond_to do |format|
26 show_html_format format
27 show_prof_format format
28 show_json_format format
46 @item = @my_model_class.new
48 @my_model_class.fold_extend_settings params[@my_model_class.item_name]
49 @item.attributes = params[@my_model_class.item_name]
56 @my_model_class.fold_extend_settings params[@my_model_class.item_name]
57 @item.attributes = params[@my_model_class.item_name]
63 @item = self.class.model.edit(params[:id], @operators)
64 respond_to do |format|
65 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => self.class.model.model_name.human)
66 format.html { redirect_to @item }
67 format.json { render json: @item.errors, status: :unprocessable_entity }