Commit 898e69b5

mo k <mo@mokhan.ca>
2012-10-08 22:47:40
set uploaded photo as the primary photo.
1 parent 7606996
Changed files (1)
app/controllers/creations_controller.rb
@@ -25,10 +25,10 @@ class CreationsController < ApplicationController
   def create
     @creation = current_user.creations.create(params[:creation])
     @creation.category_ids = params[:creation][:category_ids] ||= []
-    @creation.photos.build({:image => params[:photo]})
+    @creation.photos.build({:image => params[:photo], :is_primary => true})
 
     if @creation.save
-      redirect_to(creations_url, :notice => 'Your creation will show up in the main timeline shortly.') 
+      redirect_to(creations_url, :notice => 'Thank you for sharing your creation.') 
     else
       flash[:error] = @creation.errors.full_messages
       render :action => "new"