From 5feffa49df80cd3b6382ebcb5236ff5627d417b2 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Fri, 30 Nov 2007 15:42:04 +0000 Subject: [PATCH] ActionItem21: recording and displaying 'last change by' --- app/controllers/my_profile/cms/text_html.rb | 2 ++ app/views/cms/view.rhtml | 2 +- test/functional/cms_controller_test.rb | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/controllers/my_profile/cms/text_html.rb b/app/controllers/my_profile/cms/text_html.rb index 0321d87..67b3d82 100644 --- a/app/controllers/my_profile/cms/text_html.rb +++ b/app/controllers/my_profile/cms/text_html.rb @@ -6,6 +6,7 @@ class CmsController @article.parent = profile.articles.find(params[:parent_id]) end @article.profile = profile + @article.last_changed_by = user if request.post? if @article.save redirect_to :action => 'view', :id => @article.id @@ -16,6 +17,7 @@ class CmsController def text_html_edit @article = Article.find(params[:id]) if request.post? + @article.last_changed_by = user if @article.update_attributes(params[:article]) redirect_to :action => 'view', :id => @article.id end diff --git a/app/views/cms/view.rhtml b/app/views/cms/view.rhtml index 1074021..93ea10a 100644 --- a/app/views/cms/view.rhtml +++ b/app/views/cms/view.rhtml @@ -51,7 +51,7 @@