Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > NoMethodError at /delete/1 private method `delete'...

Reply
Thread Tools

NoMethodError at /delete/1 private method `delete'...

 
 
Joe dude
Guest
Posts: n/a
 
      11-30-2009
Hello,

I'm trying to work through the 'Meet Sinatra' PeepCode screencast and
I'm stuck trying to delete an entry.

I'm receiving this error while attempting to delete a file and database
entry:

NoMethodError at /delete/1
private method `delete' called for #<Ad:0x102949028>

* file: adserver.rb
* location: GET /delete/:id
* line: 72

Here's the entire adserver.rb file:
http://pastie.org/719776

Here's the handler that's causing problems:
http://pastie.org/719777

The error is being caused by: "ad.delete"

When the URL that is supposed to remove the file and delete the db entry
is visited (mysite.com/delete/1), the file is removed and then I receive
the error that I posted above.

Any feedback is appreciated.

Thank you
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ryan Davis
Guest
Posts: n/a
 
      11-30-2009

On Nov 29, 2009, at 17:50 , Joe dude wrote:

> Hello,
>=20
> I'm trying to work through the 'Meet Sinatra' PeepCode screencast and
> I'm stuck trying to delete an entry.
>=20
> I'm receiving this error while attempting to delete a file and =

database
> entry:
>=20
> NoMethodError at /delete/1
> private method `delete' called for #<Ad:0x102949028>
>=20
> * file: adserver.rb
> * location: GET /delete/:id
> * line: 72
>=20
> Here's the entire adserver.rb file:
> http://pastie.org/719776
>=20
> Here's the handler that's causing problems:
> http://pastie.org/719777


First off, you should probably ask this question either on the sinatra =
mailing list or the datamapper mailing list for a better and more =
accurate response.

Second, without a full backtrace we can only speculate.

If the method is private, make it public... but it is probably private =
for a reason. Looking at the API, you might want to call destroy =
instead.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
private method - Fixnum (NoMethodError) salai Ruby 3 06-30-2009 03:13 PM
NoMethodError: private method `to_date' Sukeerthi Adiga Ruby 11 07-24-2008 07:45 PM
newbie question - undefined method `replace_session_timeout' for main:Object (NoMethodError) warrene33@gmail.com Ruby 2 06-22-2007 12:21 PM
Why is my method not found? (NoMethodError) anansi Ruby 8 05-08-2007 05:24 AM
undefined method `empty?' for nil:NilClass (NoMethodError) anon1m0us Ruby 2 02-06-2007 07:28 PM



Advertisments