noesya/osuny

View on GitHub
app/controllers/admin/education/programs/application_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
42%
class Admin::Education::Programs::ApplicationController < Admin::Education::ApplicationController
  load_and_authorize_resource :program,
                              class: Education::Program,
                              through: :current_university,
                              through_association: :education_programs

  protected

  def current_subnav_context
    @program && @program.persisted? ? 'navigation/admin/education/program'
                                    : super
  end

  def breadcrumb
    super
    add_breadcrumb Education::Program.model_name.human(count: 2), admin_education_programs_path
    breadcrumb_for @program
  end

  def default_url_options
    options = super
    options[:program_id] = params[:program_id] if params.has_key? :program_id
    options
  end
end