1 class OriginalPictureLicensesController < ApplicationController
2 before_action :authenticate_user, :only => [:new, :create]
3 before_action :authenticate_artist, :only => [:new, :create]
6 # use @item, @original_picture, @form
14 @my_model_class = OriginalPictureLicense
16 @item = @my_model_class.new
17 @my_model_class.fold_extend_settings params[@my_model_class.item_name]
18 @item.attributes = @item.permit_params params
21 @original_picture = OriginalPicture.show @item.original_picture, @operators
24 # switch my_model_class
25 @item = OriginalPictureLicense.build_resource_picture @item, @original_picture, @item.permit_params(params)
26 respond_to do |format|
28 render main_app.new_resource_picture_path
33 :credits => render_to_string('credits', :formats => :html, :layout => false)
35 render json: r.to_json, status: :created
39 respond_to do |format|
41 @form = Locmare::Bucket.factory @item.item_name, 'default', @item, true, true, @operators
45 render json: @item.errors, status: :unprocessable_entity