app/helpers/admin/edition_actions_helper.rb
# If adding new models also update filter_options_for_edition
If adding new models also update filter_options_for_edition
If adding new models also update filter_options_for_edition
def document_creation_dropdown
    tag.ul(
      class: "masthead-menu list-unstyled js-hidden",
      id: "new-document-menu",
      role: "menu",
      "aria-labelledby" => "new-document-label",
    ) do
      edition_types = [
        Consultation,
        Publication,
        NewsArticle,
        Speech,
        DetailedGuide,
        DocumentCollection,
        FatalityNotice,
        CaseStudy,
        StatisticalDataSet,
      ]
      edition_types
        .select { |edition_type| can?(:create, edition_type) }
        .map { |edition_type|
          tag.li(class: "masthead-menu-item") do
            link_to(
              edition_type.model_name.human,
              polymorphic_path([:new, :admin, edition_type.name.underscore.to_sym]),
              title: "Create #{edition_type.model_name.human.titleize}",
              role: "menuitem",
            )
          end
        }
        .join
        .html_safe
    end
  end
def document_creation_dropdown tag . ul ( class : "masthead-menu list-unstyled js-hidden" , id : "new-document-menu" , role : "menu" , "aria-labelledby" => "new-document-label" , ) do edition_types = [ Consultation , Publication , NewsArticle , Speech , DetailedGuide , DocumentCollection , FatalityNotice , CaseStudy , StatisticalDataSet , ] edition_types . select { | edition_type | can? ( :create , edition_type ) } . map { | edition_type | tag . li ( class : "masthead-menu-item" ) do link_to ( edition_type . model_name . human , polymorphic_path ( [ :new , :admin , edition_type . name . underscore . to_sym ] ) , title : "Create #{edition_type.model_name.human.titleize}" , role : "menuitem" , ) end } . join . html_safe end end
If adding new models also update filter_options_for_edition
If adding new models also update filter_options_for_edition