Comments (3)
Starting at version 4.0.0 of paperclip, all attachments are required to include a content_type validation (https://github.com/thoughtbot/paperclip#security-validations).
Try with that in your model:
validates_attachment_content_type :draft, :content_type => %w(image/jpeg image/jpg image/png)
But I think you should post on Stackoverflow for this kind of problem.
from mongoid-paperclip.
still not working with validation.
thank you anyway
from mongoid-paperclip.
OK, my bug.
It's works, I changed "check params" in my controller
instead of
def create
@draft = Draft.new(draft_params)
...
def draft_params
params.permit(:draft)
end
I changed to
def create
@draft = Draft.new(params[:draft])
...
from mongoid-paperclip.
Related Issues (20)
- Release an updated version? HOT 3
- undefined method `after_commit' HOT 1
- undefined method `bson_type' for ActionDispatch::Http::UploadedFile HOT 3
- uninitialized constant Mongoid::Paperclip HOT 5
- undefined method `interpolates' for Paperclip:Module
- undefined method has_mongoid_attached_file
- Refresh missing styles HOT 1
- URL Friendly Filenames HOT 1
- Using parent ids in the embedded document path for an attachment
- Looking for collaborators. HOT 7
- Do not works with rails 4.2 and mongoid 4 HOT 2
- Can
- Not working with active record HOT 1
- Paperclip validation problem on production HOT 1
- URI::InvalidURIError: URI must be ascii only "http://xiaoniu-ads.oss-cn-hangzhou.aliyuncs.com/a/pic_paths/57bb/ad83/d44f/2108/cbae/ed45/\u{6cf8}\u{5dde}\u{8d21}.jpg" HOT 3
- [Question] How can I save image using path? HOT 1
- Be aware of using aws-sdk > 3.0 HOT 2
- Support for Paperclip >= 5.2.0? HOT 3
- Change dependency to maintained gem kt-paperclip HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoid-paperclip.