Sha256: c49c267e5a74ff19d5ee1ea8a0b43e6220700b6c67f054057a8e5171509d5e3a

Contents?: true

Size: 340 Bytes

Versions: 6

Compression:

Stored size: 340 Bytes

Contents

class Trestle::DashboardController < Trestle::ApplicationController
  def index
    admin = primary_admin
    redirect_to admin.path if admin
  end

private
  def primary_admin
    if navigation = Trestle.navigation(self).first
      navigation.admin
    elsif Trestle.admins.values.any?
      Trestle.admins.values.first
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
trestle-0.9.5 app/controllers/trestle/dashboard_controller.rb
trestle-0.9.2 app/controllers/trestle/dashboard_controller.rb
trestle-0.9.1 app/controllers/trestle/dashboard_controller.rb
trestle-0.9.0 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.13 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.12 app/controllers/trestle/dashboard_controller.rb