validates_something_else# Other validations that conflict with Paperclip's
end
classBooksController<ApplicationController
defcreate
@book=Book.new(book_params)
@book.document=params[:book][:document]
@book.save
respond_with@book
end
private
defbook_params
params.require(:book).permit(:title,:author)
end
end
```
Defaults
Defaults
--------
--------
Global defaults for all your paperclip attachments can be defined by changing the Paperclip::Attachment.default_options Hash, this can be useful for setting your default storage settings per example so you won't have to define them in every has_attached_file definition.
Global defaults for all your paperclip attachments can be defined by changing the Paperclip::Attachment.default_options Hash, this can be useful for setting your default storage settings per example so you won't have to define them in every has_attached_file definition.