Permalink
Browse files

New way to save attributes multiple into databag

  • Loading branch information...
2 parents e7934dc + 406c281 commit 3440ac6a2201634cf6d035a0152b9a81dda76c0f @amian84 amian84 committed with root Feb 8, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 app/controllers/home_users_controller.rb
@@ -1,5 +1,5 @@
class HomeUsersController < ApplicationController
-
+ helper HomeUsersHelper
def index
@users = HomeUser.all
end
@@ -29,8 +29,8 @@ def update
attribute = params[:databag][multiple].keys.first
params[:databag][multiple][attribute] = params[:databag][multiple].values.map{|x| x.values}.flatten
end
-
- Usermanagement.update(params[:databag])
+ r_hash = HomeUsersHelper.recursive_hash(params[:databag].to_hash, {})
+ Usermanagement.update(r_hash)
redirect_to edit_home_user_path(@user.username)
end

0 comments on commit 3440ac6

Please sign in to comment.