Commit 044e16fb
Changed files (2)
app
controllers
views
photos
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" %>