Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/podium/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#podlet(name) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/podium/core_ext.rb', line 4

def podlet(name)
  Podium::PodletPreview.register(name)
  prefix = "#{name}_podlet"
  scope name.to_s.dasherize, as: prefix do
    get "/", to: "#{prefix}#content", as: "content"
    get "/fallback", to: "#{prefix}#fallback"
    get "/manifest.json", to: "#{prefix}#manifest", as: "manifest"
  end
end

#podlet_previewObject



14
15
16
17
18
19
20
21
22
# File 'lib/podium/core_ext.rb', line 14

def podlet_preview
  scope "podlet-preview" do
    get "/", to: "podlet_preview#index", as: "podlet_preview"

    Podium::PodletPreview.podlets.each do |name|
      get "/#{name.to_s.dasherize}", to: "podlet_preview##{name}"
    end
  end
end