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

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

Comments

Projects
None yet
4 participants
@woaigithub

app/models/tiny_print.rb

undefined method `has_attached_file' for #Class:0x00000003346ba8

@sandipransing

This comment has been minimized.

Show comment Hide comment
@sandipransing

sandipransing Nov 1, 2012

Owner

Its because you dont have paperclip gem installed..

On Thu, Nov 1, 2012 at 6:39 PM, woaigithub notifications@github.com 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/sandipransing/rails_tiny_mce/issues/20.

Owner

sandipransing commented Nov 1, 2012

Its because you dont have paperclip gem installed..

On Thu, Nov 1, 2012 at 6:39 PM, woaigithub notifications@github.com 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/sandipransing/rails_tiny_mce/issues/20.

@woaigithub

This comment has been minimized.

Show comment Hide comment
@woaigithub

woaigithub Nov 1, 2012

https://github.com/thoughtbot/paperclip

undefined method `read_inheritable_attribute' for #Class:0x00000003e60570

https://github.com/thoughtbot/paperclip

undefined method `read_inheritable_attribute' for #Class:0x00000003e60570

@sandipransing

This comment has been minimized.

Show comment Hide comment
@sandipransing

sandipransing Nov 1, 2012

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 notifications@github.com 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/sandipransing/rails_tiny_mce/issues/20#issuecomment-9980587.

Owner

sandipransing commented Nov 1, 2012

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 notifications@github.com 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/sandipransing/rails_tiny_mce/issues/20#issuecomment-9980587.

@woaigithub

This comment has been minimized.

Show comment Hide comment
@woaigithub

woaigithub Nov 1, 2012

gem 'paperclip', '~> 3.0'

gem 'paperclip', '~> 3.0'

@woaigithub

This comment has been minimized.

Show comment Hide comment
@woaigithub

woaigithub Nov 2, 2012

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?

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

This comment has been minimized.

Show comment Hide comment
@woaigithub

woaigithub Nov 2, 2012

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

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

@woaigithub

This comment has been minimized.

Show comment Hide comment
@woaigithub

woaigithub Nov 2, 2012

`
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'.

`
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'.

@webmaster219

This comment has been minimized.

Show comment Hide comment
@webmaster219

webmaster219 Feb 15, 2013

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..

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

This comment has been minimized.

Show comment Hide comment
@aj07mm

aj07mm Dec 31, 2013

probs too here, rails 4

aj07mm commented Dec 31, 2013

probs too here, rails 4

@aj07mm

This comment has been minimized.

Show comment Hide comment
@aj07mm

aj07mm 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

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