Image Not Displaying In Paperclip

On 9 April 2015 at 08:09, Colin L. [email protected] wrote:

On 9 April 2015 at 06:06, Edward M. [email protected] wrote:

NoMethodError (undefined method validation_presence_of' for #<Class:0xa478d1c>): app/models/book.rb:2:in class:Book

Look at the line pointed to carefully and consider whether what is
there is exactly what was intended. Compare it carefully with other
examples showing similar code. When writing software, to coin a
phrase, the devil is in the detail.

Any comments on the points I made in my last post?

Colin

Colin L. wrote in post #1171817:

On 9 April 2015 at 08:09, Colin L. [email protected] wrote:

On 9 April 2015 at 06:06, Edward M. [email protected] wrote:

NoMethodError (undefined method validation_presence_of' for #<Class:0xa478d1c>): app/models/book.rb:2:in class:Book

Look at the line pointed to carefully and consider whether what is
there is exactly what was intended. Compare it carefully with other
examples showing similar code. When writing software, to coin a
phrase, the devil is in the detail.

Any comments on the points I made in my last post?

Colin

And that is what exactly i asked for in the beginning. i did said that
same program working on my frnds pc with no error but errors showing up
in validation, can i get a proper validation code ?

Colin L. wrote in post #1171724:

Exactly which folder is the file 8-captives-medium.jpg stored in?
Full path please.

On the view page in the browser do you see “8 captives medium” where
the image should be?

Post the bit of development.log showing the request for the view page
please.

Please answer all three questions to save me asking again. Thanks.

Colin
Answer 1:- app/public/images/posts/images.jpg

Answer 2:- http:// prntscr.com /6rgtxn (Remove Spaces)

Answer 3:-
Started GET “/books/new” for 127.0.0.1 at 2015-04-07 11:51:02 +0530
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT
“schema_migrations”.* FROM “schema_migrations”[0m
Processing by BooksController#new as HTML
Completed 500 Internal Server Error in 38ms (ActiveRecord: 0.7ms)

NoMethodError (undefined method validation_presence_of' for #<Class:0xa478d1c>): app/models/book.rb:2:in class:Book
app/models/book.rb:1:in <top (required)>' app/controllers/books_controller.rb:17:in new’

Rendered
/home/amit/.rvm/gems/ruby-2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_source.erb
(14.6ms)

On 10 April 2015 at 09:15, Colin L. [email protected] wrote:


As or that code working on another PC I think that is unlikely.

That should have read ‘as for that code working’ of course. I got the
detail wrong myself that time.

Colin

On 10 April 2015 at 07:53, Edward M. [email protected] wrote:

examples showing similar code. When writing software, to coin a
phrase, the devil is in the detail.

Any comments on the points I made in my last post?

Colin

And that is what exactly i asked for in the beginning. i did said that
same program working on my frnds pc with no error but errors showing up
in validation, can i get a proper validation code ?

As I said:

Look at the line pointed to carefully and consider whether what is
there is exactly what was intended. Compare it carefully with other
examples showing similar code. When writing software, to coin a
phrase, the devil is in the detail.

Try looking for documentation for validation_presence_of for example.
I doubt if you will find any. If you manage to progress in the art of
writing software you will eventually realise the truth of my statement

  • the devil is in the detail.

As or that code working on another PC I think that is unlikely.

Colin