Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="profileField">
- <%= f.label :first_name %><br/>
- <div class="field"><%= f.text_field :first_name, :size => 20, :class => 'textField', :tabIndex => '1' %></div>
- </div>
- def update
- @user = current_user
- @user.dob_string = user_params[:dob_string]
- if !@user.errors.any? && @user.update_attributes(user_params)
- last_page_visited = session[:last_page_visited]
- if !last_page_visited.nil?
- session.delete(:last_page_visited)
- else
- flash[:success] = "Profile updated"
- end
- redirect_to !last_page_visited.nil? ? last_page_visited : url_for(:controller => 'races', :action => 'index') and return
- end
- @country_selected = !@user.address.nil? && !@user.address.country.nil? ? @user.address.country : Country.cached_find_by_iso('US')
- @states = @country_selected.states.sort_by {|obj| obj.name}
- render 'edit'
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement