I am doing the tutorial on creating a blogger app from Jumpstart labs http://tutorials.jumpstartlab.com/projects/blogger.html
When i delete articles i a am running into the error "ActiveRecord::RecordNotFound in ArticlesController#show Couldn't find Article with 'id"
The error happens on line 10 of artciles_controller.rb which is @article = Article.find(params[:id])
articles_controller.rb
class ArticlesController < ApplicationController
include ArticlesHelper
def index
@articles = Article.all
end
def edit
@article = Article.find(params[:id])
end
def show
@article = Article.find(params[:id])
@comment = Comment.new
@comment.article_id = @article.id
end
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
@article.save
redirect_to article_path(@article)
end
def destroy
@article = Article.find(params[:id])
@article.destroy
redirect_to article_path(@article)
end
def update
@article = Article.find(params[:id])
@article.update(article_params)
flash.notice = "Article '#{@article.title}' Updated!"
redirect_to article_path(@article)
end
end
show.html.erb
<h1><%= @article.title %></h1>
<p><%= @article.body %></p>
<h3>Comments (<%= @article.comments.size %>)</h3>
<%= render partial: 'arti`enter code here`cles/comment', collection: @article.comments %>
<%= link_to "edit", edit_article_path(@article) %>
<%= render partial: 'comments/form' %>
<%= link_to "<< Back to Articles List", articles_path %>
<%= link_to "delete", article_path(@article) ,
method: :delete ,
data: {confirm: "Really delete the article?"}%>