samedi 12 mars 2016

Delete/Destroy is not working within Rails

I am trying to get a delete button to work using a piece of code I have written within my tags_controller page;

  def destroy
    @tag = Tag.find(params[:id])
    @tag.destroy

    redirect_to :back, notice: 'Tag was successfully deleted!'
  end

When I run from my local host, it throws an exception as shown below;

Routing Error
No route matches [DELETE] "/admin/tags/37/edit"

Rails.root: /Users/laurenwoodhams/Desktop/PROJECT/RAILS-BLOG/-t

Could you please examine and explain why this may be occurring?

Thank you

Aucun commentaire:

Enregistrer un commentaire