Sha256: 2dac718e7a13060b79ca0904d4bf74e51cdb4c49a11daca0d73afc85df94d919
Contents?: true
Size: 611 Bytes
Versions: 22
Compression:
Stored size: 611 Bytes
Contents
module Spina::Pages class PageSelectComponent < Spina::ApplicationComponent attr_accessor :name, :pages, :include_blank, :selected, :disabled def initialize(name, pages, include_blank: false, selected: nil, disabled: nil) @name = name @pages = pages @include_blank = include_blank @selected = selected @disabled = disabled end def options Spina::Page.sort_by_ancestry(pages.arrange(order: :position)).map do |page| page_menu_title = page.menu_title.indent(page.depth, '–') [page_menu_title, page.id] end end end end
Version data entries
22 entries across 22 versions & 1 rubygems