app/controllers/socials_controller.rb
# Implementation of the confirm / unconfirm action.
Implementation of the confirm / unconfirm action.
Implementation of the confirm / unconfirm action .
def toggle_confirmation( is_confirming )
    result = nil
    if request.post?                                
      if is_confirming
        result = UserSocializer.new( current_user ).confirm_with_notify( @swimming_buddy )
      else
        result = UserSocializer.new( current_user ).unconfirm_with_notify( @swimming_buddy )
      end
      flash[:info] = I18n.t( is_confirming ? 'social.confirm_successful' : 'social.unconfirm_successful' ) if result
    end
    if result.nil?
      flash[:info] = nil
      flash[:error] = I18n.t(:invalid_action_request)
    end
  end
def toggle_confirmation ( is_confirming ) result = nil if request . post? if is_confirming result = UserSocializer . new ( current_user ) . confirm_with_notify ( @swimming_buddy ) else result = UserSocializer . new ( current_user ) . unconfirm_with_notify ( @swimming_buddy ) end flash [ :info ] = I18n . t ( is_confirming ? 'social.confirm_successful' : 'social.unconfirm_successful' ) if result end if result . nil? flash [ :info ] = nil flash [ :error ] = I18n . t ( :invalid_action_request ) end end
Implementation of the confirm / unconfirm action.
Implementation of the confirm / unconfirm action .
# === POST: ===
is_confirming
<not_specific>