Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `has_attached_file' for #<Class:0x00000003346ba8> #20

Open
woaigithub opened this issue Nov 1, 2012 · 10 comments
Open

Comments

@woaigithub
Copy link

app/models/tiny_print.rb

undefined method `has_attached_file' for #Class:0x00000003346ba8

@sandipransing
Copy link
Owner

Its because you dont have paperclip gem installed..

On Thu, Nov 1, 2012 at 6:39 PM, woaigithub [email protected] wrote:

app/models/tiny_print.rb

undefined method `has_attached_file' for #Class:0x00000003346ba8


Reply to this email directly or view it on GitHubhttps://github.com//issues/20.

@woaigithub
Copy link
Author

https://github.com/thoughtbot/paperclip

undefined method `read_inheritable_attribute' for #Class:0x00000003e60570

@sandipransing
Copy link
Owner

it might be case that you are using latest version of paperclip use
appropriate for rails 2.3

On Thu, Nov 1, 2012 at 7:17 PM, woaigithub [email protected] wrote:

https://github.com/thoughtbot/paperclip

undefined method `read_inheritable_attribute' for #Class:0x00000003e60570


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-9980587.

@woaigithub
Copy link
Author

gem 'paperclip', '~> 3.0'

@woaigithub
Copy link
Author

my environment is ruby1.9.3+rails3.2.8, what branch should i use? master or rails_3? or all is ok?

http://42.121.5.68/admin/posts/new

the text_area is not rich_text_box, it is a ordinary text_area.

github.com/woaigithub/blog is my project, if you have time, please see it why do not work correctly?

@woaigithub
Copy link
Author

error is 'You need to supply at least one validation'.

@woaigithub
Copy link
Author

`
class Comment < ActiveRecord::Base
attr_accessible :content, :title, :commenter, :email, :url

belongs_to :post

validates :content, :presence => true, :length => 10..200
end
`

error is 'You need to supply at least one validation'.

@webdev36
Copy link

Hi
I've any error.
error is "undefined method `has_attached_file' for Upload:Class"

upload class is
class Upload
include Mongoid::Document
field :file_name, type: String
field :content_tye, type: String
field :file_size, type: Integer
embedded_in :artist
attr_accessible :upload, :artist_attributes
has_attached_file :upload
belongs_to :artist
validates :file_name, presence: true
include Rails.application.routes.url_helpers
def to_jq_upload
{
"name" => read_attribute(:file_name),
"size" => read_attribute(:file_size),
"url" => upload.url(:original),
"delete_url" => upload_path(self),
"delete_type" => "DELETE"
}
end
end

please help me..

@aj07mm
Copy link

aj07mm commented Dec 31, 2013

probs too here, rails 4

@aj07mm
Copy link

aj07mm commented Dec 31, 2013

i was trying to add

Paperclip

has_attached_file :foto, :styles => { :medium => "300x300>", :thumb => "100x100>" }

to the controller instead of the model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants