If you need to add the ability change passwords in the "admin" panel of boilerplate.
Add the password and password_confirmation to the User Decorator
# app/decorators/inherited_resources/user_decorator.rb
module InheritedResources
class UserDecorator < Decorator
# ...
def form_attributes
[:email, :first_name, :last_name, :birthday, :gender, :current_city,
:hometown, :avatar, :password, :password_confirmation]
end
#...
end
Then disable password validate for update, only if they don't supply a new paswword
class Admin::UsersController < Admin::ResourceController
add_crumb "Users", :admin_users_url
def update
if params[:user][:password].empty?
@user = User.find(params[:id])
@user.update_without_password(params[:user])
update!{ edit_resource_url }
else
update!{ edit_resource_url }
end
end
end
DONE! :)
I needed this in LookLites thanks!