vendor/plugins/images/app/controllers/admin/images_controller.rb in refinerycms-0.9.5.5 vs vendor/plugins/images/app/controllers/admin/images_controller.rb in refinerycms-0.9.5.6
- old
+ new
@@ -34,14 +34,12 @@
render :action => "insert"
end
def create
@image = Image.create(params[:image])
- saved = @image.valid?
- flash.now[:notice] = "'#{@image.title}' was successfully created." if saved
-
unless params[:insert]
- if saved
+ if @image.valid?
+ flash[:notice] = "'#{@image.title}' was successfully created."
unless from_dialog?
redirect_to :action => 'index'
else
render :text => "<script type='text/javascript'>parent.window.location = '#{admin_images_url}';</script>"
end
\ No newline at end of file