Sha256: 2b0638d44ee32077991f2a5c2d04b30676011b280293fd1317d513b400b1b7a0

Contents?: true

Size: 943 Bytes

Versions: 5

Compression:

Stored size: 943 Bytes

Contents

class Voluntary::ApplicationController < ActionController::Base
  include Applicat::Mvc::Controller
  include Voluntary::V1::BaseController
  
  protect_from_forgery
  
  before_filter :set_twitter_sidenav_level
  
  layout Proc.new { |controller| controller.request.xhr? ? 'facebox' : 'application' }
  
  respond_to :html, :js, :json
  
  protected

  def after_sign_in_path_for(resource_or_scope)
    if resource_or_scope.provider == 'lastfm'
      music_path
    elsif resource_or_scope.main_role.is_a? Role::ProjectOwner
      workflow_project_owner_index_path
    elsif resource_or_scope.main_role.is_a? Role::User
      workflow_user_index_path
    else
      workflow_path
    end
  end
  
  def set_twitter_sidenav_level
    @twitter_sidenav_level = 3
  end
  
  def response_with_standard(format = nil, error = nil)
    render status: error ? 500 : 200, json: { success: error ? false : true, error: error} and return true
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
voluntary-0.4.0 app/controllers/voluntary/application_controller.rb
voluntary-0.3.0 app/controllers/voluntary/application_controller.rb
voluntary-0.2.4 app/controllers/voluntary/application_controller.rb
voluntary-0.2.3 app/controllers/voluntary/application_controller.rb
voluntary-0.2.2 app/controllers/voluntary/application_controller.rb