app/controllers/almanac/blogs_controller.rb in almanac-0.7.4 vs app/controllers/almanac/blogs_controller.rb in almanac-0.8.0
- old
+ new
@@ -3,11 +3,11 @@
module Almanac
class BlogsController < ApplicationController
load_and_authorize_resource class: Almanac::Blog
respond_to :html
- before_filter :only => [:show, :edit, :update, :delete] do |controller|
+ before_filter :only => [:show, :update, :delete] do |controller|
@blog = Blog.find(params[:id])
end
def new
@blog = (Blog.first.nil?) ? Blog.new : Blog.first
@@ -37,10 +37,12 @@
end
end
end
def edit
+ @blog = Blog.first
+
respond_to do |format|
format.html
end
end
@@ -49,16 +51,9 @@
if @blog.update_attributes(params[:blog])
format.html { redirect_to :root, :notice => 'Blog was successfully updated.' }
else
format.html { render :action => "edit" }
end
- end
- end
-
- def spam
- @comments = Comment.spam
-
- respond_with(@comments) do |format|
end
end
end
end