Sha256: 68835ee114baaae378875b327104f20fe14954d71fb1f306dd96257bce381779

Contents?: true

Size: 798 Bytes

Versions: 2

Compression:

Stored size: 798 Bytes

Contents

class Iugu::RegistrationsController < Devise::RegistrationsController
  after_filter :select_account, :only => [:create,:update]

  layout IuguSDK.alternative_layout

  def new
    if !IuguSDK::default_subscription_name && IuguSDK::enable_subscription_features
      redirect_to pricing_index_path
    else
      super
    end
  end

  def try_first
    if IuguSDK::enable_guest_user
      @user = User.create_guest
      @user.remember_me = true
      sign_in @user
      select_account
      flash[:notice] = I18n.t("iugu.notices.guest_login")
      redirect_to root_path
      #respond_with @user, :location => sign_up_path_for(@user)
    else
      raise ActionController::RoutingError.new("Not found")
    end
  end

  def after_sign_up_path_for(resource)
    IuguSDK::app_main_url
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.5 app/controllers/iugu/registrations_controller.rb
iugusdk-1.0.0.alpha.4 app/controllers/iugu/registrations_controller.rb