rails_tiny_mce icon indicating copy to clipboard operation
rails_tiny_mce copied to clipboard

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

Open woaigithub opened this issue 12 years ago • 10 comments

app/models/tiny_print.rb

undefined method `has_attached_file' for #Class:0x00000003346ba8

woaigithub avatar Nov 01 '12 13:11 woaigithub

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/sandipransing/rails_tiny_mce/issues/20.

sandipransing avatar Nov 01 '12 13:11 sandipransing

https://github.com/thoughtbot/paperclip

undefined method `read_inheritable_attribute' for #Class:0x00000003e60570

woaigithub avatar Nov 01 '12 13:11 woaigithub

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

sandipransing avatar Nov 01 '12 13:11 sandipransing

gem 'paperclip', '~> 3.0'

woaigithub avatar Nov 01 '12 13:11 woaigithub

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 avatar Nov 02 '12 01:11 woaigithub

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

woaigithub avatar Nov 02 '12 01:11 woaigithub

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

woaigithub avatar Nov 02 '12 02:11 woaigithub

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

webdev36 avatar Feb 15 '13 14:02 webdev36

probs too here, rails 4

aj07mm avatar Dec 31 '13 14:12 aj07mm

i was trying to add

Paperclip

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

to the controller instead of the model

aj07mm avatar Dec 31 '13 15:12 aj07mm