1 class OriginalPictureLicensesController < ApplicationController
2 before_filter :authenticate_user, :only => [:new, :create]
3 before_filter :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 = params[@my_model_class.item_name]
21 @original_picture = OriginalPicture.show @item.original_picture, @operators
24 # switch my_model_class
25 @item = OriginalPictureLicense.build_resource_picture @item, @original_picture, params[@my_model_class.item_name]
26 respond_to do |format|
28 render main_app.new_resource_picture_path
30 format.json { render json: @item.to_json, status: :created }
33 respond_to do |format|
35 @form = Locmare::Bucket.factory @item.item_name, @item, true, true, @operators
39 render json: @item.errors, status: :unprocessable_entity