Module: Showbuilder::ShowModelView

Included in:
Showbuilder
Defined in:
lib/showbuilder/show_model_view.rb

Instance Method Summary collapse

Instance Method Details

#show_model_view(model, &block) ⇒ Object

show_model_view @product do |view|

view.show_text      :name
view.show_time      :last_update
view.show_currency  :price
view.show_percent   :discount
view.show_text_link :vendor, :name

end

dependents: text_group = @product.class.to_s.underscore I18n.t(“#text_group.number”) I18n.t(“#text_group.name”) I18n.t(“#text_group.price”)



20
21
22
23
# File 'lib/showbuilder/show_model_view.rb', line 20

def show_model_view(model, &block)
  builder = Showbuilder::Builders::ModelViewBuilder.new(model, self)
  builder.build_model_view(&block)
end