Sha256: 5c907d362b9569baccc080585db6d29f33634f7e4fe66c99f562a45aa168480b

Contents?: true

Size: 330 Bytes

Versions: 7

Compression:

Stored size: 330 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.registry.any?
      Trestle.registry.first
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trestle-0.10.1 app/controllers/trestle/dashboard_controller.rb
trestle-0.10.0 app/controllers/trestle/dashboard_controller.rb
trestle-0.10.0.pre2 app/controllers/trestle/dashboard_controller.rb
trestle-0.10.0.pre app/controllers/trestle/dashboard_controller.rb
trestle-0.9.8 app/controllers/trestle/dashboard_controller.rb
trestle-0.9.7 app/controllers/trestle/dashboard_controller.rb
trestle-0.9.6 app/controllers/trestle/dashboard_controller.rb