comparison app/controllers/users_controller.rb @ 169:bc23796a7120 feature_55

ssamr validation on my/account is now done correctly other small bug fixes.
author luisf
date Tue, 01 Feb 2011 17:50:01 +0000
parents bad82329a115
children 594ed6aef7bd
comparison
equal deleted inserted replaced
164:bb9724ba3d60 169:bc23796a7120
89 89
90 @user = User.new(:language => Setting.default_language) 90 @user = User.new(:language => Setting.default_language)
91 @auth_sources = AuthSource.find(:all) 91 @auth_sources = AuthSource.find(:all)
92 92
93 @ssamr_user_details = SsamrUserDetail.new 93 @ssamr_user_details = SsamrUserDetail.new
94
95 # default value
96 @selected_institution_id = 1
97
98
99 end 94 end
100 95
101 verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed } 96 verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
102 def create 97 def create
103 @notification_options = User::MAIL_NOTIFICATION_OPTIONS 98 @notification_options = User::MAIL_NOTIFICATION_OPTIONS
143 @notification_options = @user.valid_notification_options 138 @notification_options = @user.valid_notification_options
144 @notification_option = @user.mail_notification 139 @notification_option = @user.mail_notification
145 140
146 @ssamr_user_details = @user.ssamr_user_detail 141 @ssamr_user_details = @user.ssamr_user_detail
147 142
148 if @ssamr_user_details.institution_type.blank? 143 @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i
149 @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i
150 @institution_type = @ssamr_user_details.institution_type
151 else
152 @selected_institution_id = false
153 @institution_type = true
154 end
155
156 144
157 @auth_sources = AuthSource.find(:all) 145 @auth_sources = AuthSource.find(:all)
158 @membership ||= Member.new 146 @membership ||= Member.new
159 end 147 end
160 148