posts: display validation warnings in flash notice.
This commit is contained in:
@@ -53,7 +53,12 @@ class UploadsController < ApplicationController
|
||||
|
||||
def create
|
||||
@upload = Upload.create(params[:upload].merge(:server => Socket.gethostname))
|
||||
@upload.process! if @upload.errors.empty?
|
||||
|
||||
if @upload.errors.empty?
|
||||
post = @upload.process!
|
||||
flash[:notice] = post.warnings.full_messages.join(".\n \n") if post.present? && post.warnings.any?
|
||||
end
|
||||
|
||||
save_recent_tags
|
||||
respond_with(@upload)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user