paperclip

https://github.com/thoughtbot/paperclip

Ruby

Easy file attachment management for ActiveRecord

Paperclip::Attachment#filename_cleaner

You can either specifiy :restricted_characters or you can define your own
:filename_cleaner object. This object needs to respond to #call and takes
the filename that will be cleaned. It should return the cleaned filename.

Source | Google | Stack overflow

Edit

git clone [email protected]:thoughtbot/paperclip.git

cd paperclip

open lib/paperclip/attachment.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Paperclip--Attachment-filename_cleaner-for-pr


# Commit to git

git add lib/paperclip/attachment.rbgit commit -m "better docs for Paperclip::Attachment#filename_cleaner"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Paperclip--Attachment-filename_cleaner-for-pr

hub pull-request


# Celebrate!