Sha256: 4c80f8a17334dd6a18201abe1e233e1e5afc65bd8044d07efffbe1007413ed98

Contents?: true

Size: 794 Bytes

Versions: 14

Compression:

Stored size: 794 Bytes

Contents

PADRINO_ROOT = File.dirname(__FILE__) unless defined? PADRINO_ROOT
PADRINO_ENV = 'test' unless defined? PADRINO_ENV

require 'padrino-core'

class RenderUser
  attr_accessor :name
  def initialize(name); @name = name; end
end

class RenderDemo < Padrino::Application
  register Padrino::Helpers

  # partial with object
  get '/partial/object' do
    partial 'template/user', :object => RenderUser.new('John'), :locals => { :extra => "bar" }
  end

  # partial with collection
  get '/partial/collection' do
    partial 'template/user', :collection => [RenderUser.new('John'), RenderUser.new('Billy')], :locals => { :extra => "bar" }
  end

  # partial with locals
  get '/partial/locals' do
    partial 'template/user', :locals => { :user => RenderUser.new('John'), :extra => "bar" }
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
padrino-helpers-0.9.24 test/fixtures/render_app/app.rb
padrino-helpers-0.9.23 test/fixtures/render_app/app.rb
padrino-helpers-0.9.22 test/fixtures/render_app/app.rb
padrino-helpers-0.9.21 test/fixtures/render_app/app.rb
padrino-helpers-0.9.20 test/fixtures/render_app/app.rb
padrino-helpers-0.9.19 test/fixtures/render_app/app.rb
padrino-helpers-0.9.18 test/fixtures/render_app/app.rb
padrino-helpers-0.9.17 test/fixtures/render_app/app.rb
padrino-helpers-0.9.16 test/fixtures/render_app/app.rb
padrino-helpers-0.9.15 test/fixtures/render_app/app.rb
padrino-helpers-0.9.14 test/fixtures/render_app/app.rb
padrino-helpers-0.9.13 test/fixtures/render_app/app.rb
padrino-helpers-0.9.12 test/fixtures/render_app/app.rb
padrino-helpers-0.9.11 test/fixtures/render_app/app.rb