# HG changeset patch # User luisf # Date 1296582601 0 # Node ID bc23796a7120bf56adcb91380bf4f9fd9b8d08d8 # Parent bb9724ba3d608b164037f5c96d25154360168856 ssamr validation on my/account is now done correctly other small bug fixes. diff -r bb9724ba3d60 -r bc23796a7120 app/controllers/my_controller.rb --- a/app/controllers/my_controller.rb Mon Jan 31 20:59:31 2011 +0000 +++ b/app/controllers/my_controller.rb Tue Feb 01 17:50:01 2011 +0000 @@ -55,9 +55,6 @@ @ssamr_user_details = @user.ssamr_user_detail @selected_institution_id = @ssamr_user_details.institution_id.to_i - logger.info "Mercedes" - - logger.info @selected_institution_id if request.post? @user.attributes = params[:user] @@ -72,6 +69,7 @@ @ssamr_user_details = @user.ssamr_user_detail end + if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty? @ssamr_user_details.description = @user.ssamr_user_detail.description @ssamr_user_details.institution_id = @user.ssamr_user_detail.institution_id @@ -82,7 +80,6 @@ @ssamr_user_details.institution_id = params[:ssamr_user_details][:institution_id] @ssamr_user_details.institution_type = params[:ssamr_user_details][:institution_type] @ssamr_user_details.other_institution = params[:ssamr_user_details][:other_institution] - @ssamr_user_details.save! end @selected_institution_id = @ssamr_user_details.institution_id.to_i diff -r bb9724ba3d60 -r bc23796a7120 app/controllers/users_controller.rb --- a/app/controllers/users_controller.rb Mon Jan 31 20:59:31 2011 +0000 +++ b/app/controllers/users_controller.rb Tue Feb 01 17:50:01 2011 +0000 @@ -91,11 +91,6 @@ @auth_sources = AuthSource.find(:all) @ssamr_user_details = SsamrUserDetail.new - - # default value - @selected_institution_id = 1 - - end verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed } @@ -145,14 +140,7 @@ @ssamr_user_details = @user.ssamr_user_detail - if @ssamr_user_details.institution_type.blank? - @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i - @institution_type = @ssamr_user_details.institution_type - else - @selected_institution_id = false - @institution_type = true - end - + @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i @auth_sources = AuthSource.find(:all) @membership ||= Member.new diff -r bb9724ba3d60 -r bc23796a7120 app/views/users/_form.rhtml --- a/app/views/users/_form.rhtml Mon Jan 31 20:59:31 2011 +0000 +++ b/app/views/users/_form.rhtml Tue Feb 01 17:50:01 2011 +0000 @@ -1,5 +1,6 @@ <%= javascript_include_tag "ssamr_institutions" %> +<%= javascript_include_tag "ssamr_registration" %> <%= error_messages_for 'user' %>