Sha256: 99c55ec93bbe8889f728fd08da51ff9bde1ec4ab28f7577f15265f3dfcb60784

Contents?: true

Size: 1013 Bytes

Versions: 7

Compression:

Stored size: 1013 Bytes

Contents

!!! 5

/ Why should be poor templates so low-level?
/ Even they deserve their Kernel#require!
- includes "shared/google_analytics.html"

%html
  %head
    / This is a great fun, the content for the block value
    / can be just anything, not just some dumb string.
    / The default value is there just in case that no
    / scripts would be provided in children templates.
    - block(:scripts, Array.new).each do |script|
      %script{src: "/scripts/#{script}"}
  %body
    / Just to make sure that the default value for
    / method works (as defined in example.rb).
    %form{action: "/search"}

    = block(:google_analytics)
    = block(:main) do
      / This is default content for the 'main' block.
      / In case that we wouldn't fill in the block in
      / any of child templates, the default content
      / would be rendered. If we fill in the block,
      / the default content is ignored.

      / We can use either block(name, content)
      / or block(name) { content }.

      No content yet.

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
template-inheritance-0.3.1 example/base.html.haml
template-inheritance-0.3 example/base.html.haml
template-inheritance-0.2 example/base.html.haml
template-inheritance-0.1.3 example/base.html.haml
template-inheritance-0.1.2 example/base.html.haml
template-inheritance-0.1.1 example/base.html.haml
template-inheritance-0.1 example/base.html.haml