Questions tagged [paperclip-validation]

89 questions
0
votes
1 answer

Paperclip synatx; which way is the proper way of handling validates_attachment_content_type

I'm using the ruby gem paperclip to handle image attachments and I'm adding validates_attachment_content_type to my books model. I just have a question on syntax. Which is the proper way of doing the above? validates_attachment_content_type :image,…
Dipet
  • 323
  • 3
  • 14
0
votes
1 answer

Paperclip gem showing Broken image in ruby-on-rails

I am using ruby on rails to upload pics to my website with the paperclip gem, the image uploads but shows that it is broken on the website (i.e does not appear fully)I have done everything know, even searched online for solutions but the image…
0
votes
1 answer

The GEM paperclip saved my images in public/system not in app/assets/images

I am using the gem PaperClip for upload images to my server , but the images are stored in public/system I need to change this ubication to app/assets/images class User < ActiveRecord::Base attr_accessible :email, :name,:photo validates :name,…
0
votes
0 answers

Image upload AngularJs to Rails4 API

I have an angularJs app that sends a base64 encoded image (or file) to my rails4 server api that uses paperclip to store attachments. Everything works fine until the content_type_validation paperclip does. For some reason, paperclip determines the…
0
votes
1 answer

Ruby/Rails ActiveAdmin Image Validator Error

I'm using Rails 4.1, Ruby 2.0, and ActiveAdmin from github I'm extremely new to rails. but basically all I want is an active admin form that will allow image uploading, and then save the URL to a string in the model called img_url. Currently, it…
0
votes
1 answer

getting validation error when trying to attach image via paperclip

I am trying to attach an image via paperclip. But not working. The default image is showing fine. But I cant upload images using the browse option. Here is the error am getting. "1 error prohibited this listing from being saved: Image has an…
Abhilash
  • 2,864
  • 3
  • 33
  • 67
0
votes
1 answer

After adding validation for Paperclip 4.1, image still fails to upload, yet Rails says listing was updated successfully

When reviewing the server log, it appears the file is being uploaded, then immediately deleted. When the process completes, I receive the message "Listing updated successfully" and there is no image, thumbnail or default image showing. Why is this…
0
votes
2 answers

Paperclip type validation always giving error

I recently updated to Paperclip 4 (4.1.1 to be specific) where it is necessary to validate files with validates_attachment. I tried it 3 ways, as the GitHub docs suggest: validates_attachment_content_type :avatar, :content_type =>…
Rickye
  • 1,023
  • 1
  • 9
  • 16
0
votes
1 answer

Rails: prevent submitting form if field is blank

I am creating product page, where user can upload more than one photo of product. To create and edit product, i am rendering a form file. For uploading photos, i have used nested_fields for photos in the form of the product. Here is how photo code…
0
votes
3 answers

Paperclip override validates_attachment in subclass

I am trying to override validates_attachment in Subclass but I notice it only works well with Superclass validation; I wonder why my validates_attachment in subclass doesn't work. Has anybody faced this problem? and how have you solved this problem?…
Sinal
  • 1,155
  • 5
  • 17
  • 35
0
votes
0 answers

Rails, Paperclip; Validate Attachment

I want validate the file content of a paperclip attachment (https://github.com/thoughtbot/paperclip). My model: class PackageArchive < ActiveRecord::Base attr_accessible :package has_attached_file :package validates_attachment :package, …
Heiko
  • 394
  • 1
  • 4
  • 14
0
votes
1 answer

Changing Error Message in Rails Model

I have a Rails (3.1) app with a model validation that, when triggered, puts the model and field name before the message, e.g.: Profile image profile image content type Only jpeg, gif and png files are allowed for profile pictures Is there a way to…
yellowreign
  • 3,528
  • 8
  • 43
  • 80
0
votes
1 answer

Why does my Paperclip validates_attachment_presence test fail?

In my Rails 3.2.2 project, I have the following: class Photo < ActiveRecord::Base belongs_to :album default_scope order: :title extend FriendlyId friendly_id :title, :use => :slugged validates :title, :presence => true validates :title,…
croceldon
  • 4,511
  • 11
  • 57
  • 92
-2
votes
1 answer

Rails - Paperclip ROLLBACK due to associations

I have 3 models. The question, answer and photo. I am using paperclip to save images. Questions and answers can have multiple images. However, I get ROLLBACK when saving images for answer model. I don't get ROLLBACK when saving images for question…
1 2 3 4 5
6