lib/comatose_admin_controller.rb in aslakjo-comatose-2.0.5.7 vs lib/comatose_admin_controller.rb in aslakjo-comatose-2.0.5.8
- old
+ new
@@ -23,31 +23,38 @@
@page.update_attributes(params[:page])
@page.updated_on = Time.now
@page.author = fetch_author_name
if @page.save
begin
- instance_eval &Comatose.config.controller_before_update
+ instance_eval &Comatose.config.controller_edit_after_page_save
rescue Exception => e
p e
end
expire_cms_page @page
expire_cms_fragment @page
flash[:notice] = "Saved changes to '#{@page.title}'"
redirect_to :controller=>self.controller_name, :action=>'index'
end
+ else
+ begin
+ instance_eval &Comatose.config.controller_edit_show
+ rescue Exception => e
+ p e
+ end
end
+
end
# Create a new page (posts back)
def new
@root_pages = [fetch_root_page].flatten
if request.post?
@page = ComatosePage.new params[:page]
@page.author = fetch_author_name
if @page.save
begin
- instance_eval &Comatose.config.controller_before_new
+ instance_eval &Comatose.config.controller_new_after_page_save
rescue Exception => e
p e
end
flash[:notice] = "Created page '#{@page.title}'"