templates/admin/users.rb in prologue-0.3.0 vs templates/admin/users.rb in prologue-0.3.6
- old
+ new
@@ -20,11 +20,13 @@
FILE
end
inject_into_file 'app/controllers/admin/users_controller.rb', :after => "def create\n" do
<<-'FILE'
- @user = User.new(params[:user])
+ @user = User.new
+ # attr_accessor logic here
+ @user.attributes = params[:user]
if @user.save
flash[:notice] = "User created!"
redirect_to admin_users_url
else
render :action => 'new'
@@ -34,10 +36,10 @@
inject_into_file 'app/controllers/admin/users_controller.rb', :after => "def update\n" do
<<-'FILE'
params[:user].delete(:password) if params[:user][:password].blank?
params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank?
-
+ # attr_accessor logic here
if @user.update_attributes(params[:user])
flash[:notice] = "Successfully updated #{@user.name}."
redirect_to admin_users_url
else
render :action => 'edit'