Commit 044e16fb

mo k <mo@mokhan.ca>
2012-10-18 13:45:37
fix the redirect_to the new photos page.
1 parent 69e7fca
Changed files (2)
app
app/controllers/creations_controller.rb
@@ -28,7 +28,7 @@ class CreationsController < ApplicationController
     @creation.category_ids = params[:creation][:category_ids] ||= []
 
     if @creation.save
-      redirect_to(new_creation_photo_url) 
+      redirect_to new_creation_photo_url(@creation)
     else
       flash[:error] = @creation.errors.full_messages
       render :action => "new" 
app/views/photos/_form.html.erb
@@ -3,7 +3,7 @@
     $(function(){ });
   </script>
 <% end %>
-<%= form_for(@photo, :html => {:multipart => true, :class => "form-horizontal"}) do |f| %>
+<%= form_for([@creation, @photo], :html => {:multipart => true, :class => "form-horizontal"}) do |f| %>
   <fieldset>
     <div class="control-group">
       <%= f.label :image, "Upload Main Image", :class => "control-label" %>