Permalink
Browse files

add an admin layout. use a password_field for the password in the set…

…tings editor. make the correct action render when invalid settings are given and a save fails.
  • Loading branch information...
1 parent 2a94954 commit dd7fb662e14cf3bead6af078d09b4838dcbf7d74 @timriley committed Jul 2, 2008
@@ -2,4 +2,6 @@ class Admin::AdminController < ApplicationController
include SingleLogin
before_filter :login_required
+
+ layout 'admin'
end
@@ -16,7 +16,7 @@ def update
flash[:notice] = 'Settings saved'
format.html { redirect_to admin_settings_path }
else
- format.html { render 'index' }
+ format.html { render :action => 'show' }
end
end
end
View
@@ -30,6 +30,8 @@ def save
self.crypted_password = self.password unless self.password.blank?
File.open("#{Rails.root}/config/config.yml", 'w') { |f| YAML.dump(@raw_tree, f) }
+
+ # FIXME find out what I should return from a successful save
else
false
end
@@ -13,7 +13,7 @@
%p
= f.label :password, 'Admin password'
%br
- = f.text_field :password
+ = f.password_field :password
%p
= f.submit 'Save'

0 comments on commit dd7fb66

Please sign in to comment.