Sha256: a5941c5ee481b7d879a4454a40ead1b30af204b07f699f2a302b963d95fc0eba

Contents?: true

Size: 567 Bytes

Versions: 22

Compression:

Stored size: 567 Bytes

Contents

module ConstructorPages
  module PagesHelper
    def for_select(roots)
      result = []
      roots.each do |r|
        r.self_and_descendants.each {|i| result.push(["#{'--'*i.level} #{i.name}", i.id, {'data-full_url' => i.full_url}])}
      end
      result
    end

    def templates
      Template.all.map{|t| ["#{'--'*t.level} #{t.name}", t.id]}
    end

    def image_tag_with_at2x(name_at_1x, options={})
      name_at_2x = name_at_1x.gsub(%r{\.\w+$}, '@2x\0')
      image_tag(name_at_1x, options.merge("data-at2x" => asset_path(name_at_2x)))
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
constructor-pages-0.6.1 app/helpers/constructor_pages/pages_helper.rb
constructor-cms-0.6.1 pages/app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.6.0 app/helpers/constructor_pages/pages_helper.rb
constructor-cms-0.6.0 pages/app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.8 app/helpers/constructor_pages/pages_helper.rb
constructor-cms-0.5.8 pages/app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.7 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.6 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.5 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.4 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.3 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.2 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.1 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.5.0 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.4.0 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.3.3 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.3.2 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.3.1 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.3.0 app/helpers/constructor_pages/pages_helper.rb
constructor-pages-0.2.14 app/helpers/constructor_pages/pages_helper.rb