noosfero | Rename upload file (!1272)

Rodrigo Souto gitlab at mg.gitlab.com
Thu Jul 6 16:04:31 BRT 2017


Rodrigo Souto started a new discussion on app/controllers/my_profile/cms_controller.rb:

>      if request.post? && params[:uploaded_files]
>        params[:uploaded_files].each do |file|
>          unless file == ''
> +	  filename = params['uploaded_file']['filename']
> +	  file.original_filename = filename unless filename == ''

filename might be `nil`. To test for both emtpy string and `nil` use `blank?`

---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1272#note_34374362
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170706/a35495d5/attachment-0001.html>


More information about the Noosfero-dev mailing list