Skip to content

Instantly share code, notes, and snippets.

@alexbrinkman
Last active July 22, 2016 18:19
Show Gist options
  • Select an option

  • Save alexbrinkman/7ad4c41f781e862d04300cda8b5500d4 to your computer and use it in GitHub Desktop.

Select an option

Save alexbrinkman/7ad4c41f781e862d04300cda8b5500d4 to your computer and use it in GitHub Desktop.

Revisions

  1. alexbrinkman revised this gist Jul 22, 2016. 2 changed files with 22 additions and 22 deletions.
    22 changes: 22 additions & 0 deletions example1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # POST /resource
    def create
    build_resource(sign_up_params)

    resource.save
    yield resource if block_given?
    if resource.persisted?
    if resource.active_for_authentication?
    set_flash_message :notice, :signed_up if is_flashing_format?
    sign_up(resource_name, resource)
    respond_with resource, location: after_sign_up_path_for(resource)
    else
    set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_flashing_format?
    expire_data_after_sign_in!
    respond_with resource, location: after_inactive_sign_up_path_for(resource)
    end
    else
    clean_up_passwords resource
    set_minimum_password_length
    respond_with resource
    end
    end
    22 changes: 0 additions & 22 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,22 +0,0 @@
    # POST /resource
    def create
    build_resource(sign_up_params)

    resource.save
    yield resource if block_given?
    if resource.persisted?
    if resource.active_for_authentication?
    set_flash_message :notice, :signed_up if is_flashing_format?
    sign_up(resource_name, resource)
    respond_with resource, location: after_sign_up_path_for(resource)
    else
    set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_flashing_format?
    expire_data_after_sign_in!
    respond_with resource, location: after_inactive_sign_up_path_for(resource)
    end
    else
    clean_up_passwords resource
    set_minimum_password_length
    respond_with resource
    end
    end
  2. alexbrinkman created this gist Jul 22, 2016.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # POST /resource
    def create
    build_resource(sign_up_params)

    resource.save
    yield resource if block_given?
    if resource.persisted?
    if resource.active_for_authentication?
    set_flash_message :notice, :signed_up if is_flashing_format?
    sign_up(resource_name, resource)
    respond_with resource, location: after_sign_up_path_for(resource)
    else
    set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_flashing_format?
    expire_data_after_sign_in!
    respond_with resource, location: after_inactive_sign_up_path_for(resource)
    end
    else
    clean_up_passwords resource
    set_minimum_password_length
    respond_with resource
    end
    end