Permalink
Browse files

descreace flog count for PagesController#update and #create actions

  • Loading branch information...
ck3g committed Mar 24, 2013
1 parent 1473255 commit 9911a664238528bb2d31e18af493f6052a27642f
Showing with 6 additions and 9 deletions.
  1. +6 −9 app/controllers/pages_controller.rb
@@ -1,6 +1,8 @@
class PagesController < ApplicationController
authorize_resource
+ respond_to :html
+
before_filter :find_page, only: [:edit, :update, :destroy]
def index
@@ -18,23 +20,18 @@ def new
def create
@page = Page.new params[:page]
- if @page.save
- redirect_to pages_path, notice: t(:created_successfully)
- else
- render :new
- end
+ flash[:notice] = t(:created_successfully) if @page.save
+ respond_with @page, location: pages_path
end
def edit
end
def update
if @page.update_attributes params[:page]
- @page.reload
- redirect_to pages_path, notice: t(:updated_successfully)
- else
- render :edit
+ flash[:notice] = t(:updated_successfully)
end
+ respond_with @page, location: pages_path
end
def destroy

0 comments on commit 9911a66

Please sign in to comment.