OSDN Git Service

build pictures
[pettanr/pettanr.git] / app / controllers / standard_licenses_controller.rb
index 993e210..1b106b9 100644 (file)
@@ -45,10 +45,12 @@ class StandardLicensesController < ApplicationController
     @license_group = LicenseGroup.show @original_picture_license_group.license_group_id
     @standard_license = StandardLicense.new params[:standard_license]
     @license = License.show @standard_license.license_id
-    @resource_picture = ResourcePicture.new :original_picture_id => @original_picture.id, 
-      :license_id => @license.id, :artist_name => @standard_license.artist_name, 
+    @resource_picture = @original_picture.resource_picture || ResourcePicture.new
+    @resource_picture.attributes = {
+      :original_picture_id => @original_picture.id, :license_id => @license.id, 
+      :artist_name => @standard_license.artist_name, :classname => @license_group.classname, 
       :credit => @standard_license.credit, :settings => @license.settings
-
+    }
     respond_to do |format|
       if @standard_license.valid?
         format.html { render :template => "resource_pictures/new" }