On Thu, Feb 12, 2009 at 5:11 AM, LAN-SUN-LUK Benjamin
<Benjamin.LAN-SUN-LUK(a)supinfo.com> wrote:
Signed-off-by: Benjamin LAN-SUN-LUK
<benjamin.lan-sun-luk(a)supinfo.com>
ACK, but with a few comments.
---
app/controllers/home_controller.rb | 6 +++++-
app/views/home/index.html.erb | 3 +--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 15d708c..6666871 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -28,7 +28,11 @@ class HomeController < ApplicationController
:except => [:index, :error, :login, :register, :generate_new_password]
def index
-
+ @content = ConfigProperty.fetch('home_page')
We should settle on a naming scheme for config property elements. I
would propose something like "text.homepage" to make it explicit.
Also, we should always return something, so pass in as the second
argument the name of the field. That way if no value has been
configured the admin can see what field needs to be configured.
+ if @content.nil?
If you follow the above, you won't need a nil check. Also, if the
fetch call fails then this line will cause a nil exception. :D
+ ConfigProperty.store('home_page',
"<h1>Welcome To Another Installation Of ProjXP!</h1>")
+ @content = ConfigProperty.fetch('home_page')
+ end
end
def error
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb
index e9aeb91..110ab83 100644
--- a/app/views/home/index.html.erb
+++ b/app/views/home/index.html.erb
@@ -1,2 +1 @@
-<h1>Welcome To Another Installation Of ProjXP!</h1>
-
+<%= @content %>
--
1.5.6.3
_______________________________________________
projxp-devel mailing list
projxp-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/projxp-devel
--
Darryl L. Pierce <mcpierce(a)gmail.com>
Visit the Infobahn Offramp: <
http://mcpierce.multiply.com>
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant