Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8210373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:03:27+00:00 2026-06-07T10:03:27+00:00

When I go to delete a post I keep receiving an error that says

  • 0

When I go to delete a post I keep receiving an error that says

undefined method `destroy’ for “Tech”:String

The “tech” part of the posts varies with whatever the tag is of the post I am trying to delete. I am not sure what the problem is. I am using acts_as_taggable_on if that has anything to do with it.

This is my destroy method in my posts controller:

   def destroy
     @post = Post.find(params[:id])
     @post.destroy

     respond_to do |format|
       format.html { redirect_to(root_path) }
       format.xml  { head :ok }
       format.json { head :ok }
     end
   end

The delete button in my post show:

  <%= button_to 'Delete', @post, :method => :delete, :confirm => "Are you sure?" %>

Tags are saved in the database as a string.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:03:28+00:00Added an answer on June 7, 2026 at 10:03 am

    It’s impossible to give you an answer to fix your problem, because you are giving no code and no examples.

    Nonetheless that error means you are calling the destroy method on a string, and strings in Ruby do not have a destroy method defined.

    Check where are you calling destroy, because it seems you are doing it in some function that returns a string (a tag name in your case). You must do it on an object that is an instance of the Tag class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML form performing a DELETE request (method = POST & hidden
I have some code that will delete a post from the database: mysql_query(DELETE FROM
EDIT: I don't want to delete the post because I have learned a lot
I have a CGI application written in C. When I POST (delete data) to
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
I'm trying to delete a blog post on blogger.com using Blogger API via Prototype
$(#button_title_delete).click(function(){ jQuery.ajax({type:'POST', url:'delete.php', data: 'id='+$(bid).val(), success: function(veri) { $(#delete_result).html(veri);} }); }); When i click
I want to delete a row in the grid, but the grid always post's
Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) This should be
You have an error in your SQL syntax; check the manual that corresponds to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.