Sha256: e73b339912dd4b04a708ef43d3589116a124472a518b3440700fee7d104f91d0

Contents?: true

Size: 419 Bytes

Versions: 3

Compression:

Stored size: 419 Bytes

Contents

# frozen_string_literal: true

module Views
	class Blog < ApplicationView
		def initialize
			@posts = []
		end

		def template(&block)
			capture(&block)

			h3(class: "font-bold") { @header }

			@posts.each do |post|
				article(class: "drop-shadow p-5 rounded") { post }
			end
		end

		def with_header(&block)
			@header = capture(&block)
		end

		def with_post(&block)
			@posts << capture(&block)
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
phlex-rails-0.4.2 fixtures/dummy/app/views/blog.rb
phlex-rails-0.4.1 fixtures/dummy/app/views/blog.rb
phlex-rails-0.4.0 fixtures/dummy/app/views/blog.rb