Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
4f76d953
Commit
4f76d953
authored
Jun 15, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rails5 fix format in uploads actions
parent
5297e94d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
app/controllers/concerns/uploads_actions.rb
app/controllers/concerns/uploads_actions.rb
+13
-0
changelogs/unreleased/rails5-fix-46276.yml
changelogs/unreleased/rails5-fix-46276.yml
+5
-0
No files found.
app/controllers/concerns/uploads_actions.rb
View file @
4f76d953
module
UploadsActions
extend
ActiveSupport
::
Concern
include
Gitlab
::
Utils
::
StrongMemoize
include
SendFileUpload
UPLOAD_MOUNTS
=
%w(avatar attachment file logo header_logo favicon)
.
freeze
included
do
prepend_before_action
:set_html_format
,
only: :show
end
def
create
link_to_file
=
UploadService
.
new
(
model
,
params
[
:file
],
uploader_class
).
execute
...
...
@@ -41,6 +47,13 @@ module UploadsActions
private
# Explicitly set the format.
# Otherwise rails 5 will set it from a file extension.
# See https://github.com/rails/rails/commit/84e8accd6fb83031e4c27e44925d7596655285f7#diff-2b8f2fbb113b55ca8e16001c393da8f1
def
set_html_format
request
.
format
=
:html
end
def
uploader_class
raise
NotImplementedError
end
...
...
changelogs/unreleased/rails5-fix-46276.yml
0 → 100644
View file @
4f76d953
---
title
:
Rails5 fix format in uploads actions
merge_request
:
19907
author
:
Jasper Maes
type
:
fixed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment