add_more ok

This commit is contained in:
Matthew K. Fu JuYuan authored and chris committed 2012-11-20 09:52:50 +08:00
1 parent 69bf552fa7
commit be448d42c9
12 files changed
+645 -489

No files matched your search

@@ -35,7 +35,6 @@ class Admin::UsersNewInterfaceController < ApplicationController
attribute_values = @user.attribute_values
attribute_values.each{|att_val|
binding.pry if att_val.id.to_s == '5052dab52b5c49ae9d000006'
@profile_data.push({:name => att_val.attribute_field.title,:value =>att_val.get_value_by_locale(I18n.locale.to_s)}) if att_val.attribute_field.attribute.key=="profile" rescue false
}
@@ -79,7 +78,7 @@ class Admin::UsersNewInterfaceController < ApplicationController
# @user.attribute_values.build(value)
# }
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
binding.pry
# binding.pry
if @user.save
flash[:notice] = t('create.success.user')
redirect_to :action => :index
@@ -104,6 +103,7 @@ class Admin::UsersNewInterfaceController < ApplicationController
def update
@user = User.find(params[:id])
@user.update_attributes(params[:user])
attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
attribute_values = params[:user].delete(attribute_values_key)