Help in deleting data from database

20 views
Skip to first unread message

Aspiring.Student.programmer

unread,
Sep 29, 2014, 3:11:17 AM9/29/14
to rubyonra...@googlegroups.com
Hey

In section 5.13 of getting started with rails it shows how to delete data from the database. When i added the code i got this error. I have checked my code and cant find any problems. Help Please


Colin Law

unread,
Sep 29, 2014, 4:18:54 AM9/29/14
to rubyonra...@googlegroups.com
On 29 September 2014 08:11, Aspiring.Student.programmer
> <img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAABVYAAA...

You say it is an error but it does not look like an error message, it
looks like some html generated by an image_tag or similar. Show us
the line in your view that is generating that. If it is not coming
from a line in your view what do you see in development.log when it
happens?

Colin



>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/7c102d01-c473-4d0d-b8fb-152df9d7cbed%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Norbert Melzer

unread,
Sep 29, 2014, 3:09:45 PM9/29/14
to Rails Mailinglist

I'd guess that He wanted to Show us a screenshot of the actual errormessage but his MUA got the HTML-mail wrong. Or our MUA does not support that kind of embedded images. Since I'm with my mobile right now I can't check the OPs mailheaders for misinformation.

Colin Law

unread,
Sep 29, 2014, 3:25:36 PM9/29/14
to rubyonra...@googlegroups.com
On 29 September 2014 20:09, Norbert Melzer <timm...@gmail.com> wrote:
> I'd guess that He wanted to Show us a screenshot of the actual errormessage
> but his MUA got the HTML-mail wrong. Or our MUA does not support that kind
> of embedded images. Since I'm with my mobile right now I can't check the OPs
> mailheaders for misinformation.

Ah, you could be right.
@Aspiring Student if so then copy the error out of the server terminal
window and paste it here, assuming it is in the server window. You
may have to use Ctrl+Chift+C to copy from a terminal window.
If it only appears in the browser then just retype it if you can't
copy text out of it.

Colin
> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVsuuBFtF7VrO8-vGLk_3oD2a6Q1S9nhUhC6RyECwD26ScA%40mail.gmail.com.

Jason Fleetwood-Boldt

unread,
Sep 29, 2014, 4:15:35 PM9/29/14
to rubyonra...@googlegroups.com

Interesting... I saw his image just fine (it says Couldn't find article with id='5' incidentally).

I am on Mac OS X Mail client. 

sabri...@gmail.com --- Yes, Colin is right, you do not need to take a screenshot of the error message, generally we prefer that you copy & paste the text of the error message itself. (You can also paste code, error messages, or stacktraces into http://gist.github.com  click "Create Private Gist" and then provide us with the URL that Gist creates for that)

As far as your original question, it looks like there is no article in the database with id 5. This could happen when you hit "Delete" twice before the app has a chance to reload the page, or maybe you deleted the record already.  Either way, you can drop into rails console and just do Article.find(5) and you will see nil as the result -- indicating that there is no record with an id of 5.

So, your code looks OK but for some reason the id being passed was for a record that didn't exist. If this continues to happen, try copying & pasting the View template into a Gist -- that will help us see the whole picture.

-Jason
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvno2EPX8YM0k%2BcbR6jh%2Bm0A%2BxoyAk0TiGN8XdiBUAtfw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages