creation of attachment_upload_helpers and integration in the code
This commit is contained in:
parent
5df3838173
commit
b8a49e9012
6 changed files with 27 additions and 28 deletions
19
app/helpers/attachment_upload_helper.rb
Normal file
19
app/helpers/attachment_upload_helper.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
module AttachmentUploadHelper
|
||||
def image_upload_and_render(form, file, direct_upload = nil)
|
||||
render 'shared/attachment/edit', {
|
||||
form: form,
|
||||
attached_file: file,
|
||||
accept: 'image/png, image/jpg, image/jpeg',
|
||||
user_can_destroy: true,
|
||||
direct_upload: direct_upload
|
||||
}
|
||||
end
|
||||
|
||||
def text_upload_and_render(form, file)
|
||||
render 'shared/attachment/edit', {
|
||||
form: form,
|
||||
attached_file: file,
|
||||
user_can_destroy: true
|
||||
}
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue