When uploading images directly from /refinery/images/new redirect back t... #1904

Merged
merged 1 commit into from Aug 29, 2012

Conversation

Projects
None yet
2 participants
Owner

ugisozols commented Aug 27, 2012

...o /refinery/images.

I changed the code because when I tried to upload images using direct path /refinery/images/new it would reload the same window and not redirect back to /refinery/images.

I wasn't sure about introducing refinery url helper in js so maybe we should approach this differently.

@parndt parndt commented on the diff Aug 27, 2012

...s/app/controllers/refinery/admin/images_controller.rb
@@ -55,12 +55,10 @@ def create
unless params[:insert]
if @images.all?(&:valid?)
flash.notice = t('uploaded_successfully', :scope => 'refinery.admin.images.form')
- if from_dialog?
- @dialog_successful = true
- render :nothing => true, :layout => true
- else
- redirect_to refinery.admin_images_path
- end
+
+ @dialog_successful = true if from_dialog?
+
+ render :nothing => true, :layout => true
@parndt

parndt Aug 27, 2012

Owner

what if they're not using a dialogue?

@ugisozols

ugisozols Aug 28, 2012

Owner

That's the case I was trying to fix. They'll get redirected back to /refinery/images by https://github.com/resolve/refinerycms/pull/1904/files#L0R54

parndt merged commit f8061d9 into master Aug 29, 2012

1 check failed

default The Travis build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment