ClevelandOnRails / rubyonrailsbook

Learn Ruby on Rails. Use coupon code GITHUB2013 on LeanPub for a discount!
https://leanpub.com/Ruby-on-Rails-The-little-Gem-that-Could
Other
9 stars 2 forks source link

destroy, not delete! #53

Closed jrgifford closed 11 years ago

jrgifford commented 11 years ago
  def destroy
    @article = Article.find(params[:article_id])
    @comment = @article.comments.find(params[:id])
    @comment.destroy
    redirect_to article_path(@article)
  end

Fix this.

  <p>
      <%= link_to "Destroy Comment", [comment.article, comment],
     :method => :delete,
      :confirm => "Are you sure?" %>
    </p>
jrgifford commented 11 years ago

point of interest: find commit that changed this.