# HG changeset patch # User luisf # Date 1296507571 0 # Node ID bb9724ba3d608b164037f5c96d25154360168856 # Parent 9a5a265e77f03fa4610ed70130605efc1ac9a404 my account view working correctly. diff -r 9a5a265e77f0 -r bb9724ba3d60 app/controllers/my_controller.rb --- a/app/controllers/my_controller.rb Mon Jan 31 18:10:55 2011 +0000 +++ b/app/controllers/my_controller.rb Mon Jan 31 20:59:31 2011 +0000 @@ -53,6 +53,12 @@ @user = User.current @pref = @user.pref @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] @user.mail_notification = params[:notification_option] || 'only_my_events' @@ -69,12 +75,18 @@ 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 + @institution_type = @ssamr_user_details.institution_type + @other_institution = @ssamr_user_details.other_institution else @ssamr_user_details.description = params[:ssamr_user_details][:description] @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 + if @user.save @user.pref.save @user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : []) diff -r 9a5a265e77f0 -r bb9724ba3d60 app/views/my/account.rhtml --- a/app/views/my/account.rhtml Mon Jan 31 18:10:55 2011 +0000 +++ b/app/views/my/account.rhtml Mon Jan 31 20:59:31 2011 +0000 @@ -49,7 +49,7 @@
<%= ssamr_user_detail.radio_button :institution_type, false %> Other: - <%= ssamr_user_detail.text_field :other_institution %> + <%= ssamr_user_detail.text_field :other_institution, :size => 19 %>
<% end %> diff -r 9a5a265e77f0 -r bb9724ba3d60 app/views/users/_form.rhtml --- a/app/views/users/_form.rhtml Mon Jan 31 18:10:55 2011 +0000 +++ b/app/views/users/_form.rhtml Mon Jan 31 20:59:31 2011 +0000 @@ -29,7 +29,6 @@ <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> -<%= ssamr_user_detail.radio_button :institution_type, true %> <%= ssamr_user_detail.collection_select(:institution_id, Institution.all, :id, :name, {:selected => @selected_institution_id} ) %>