Fix partials with locals
This commit is contained in:
parent
d12b3a95d2
commit
7a4d8c7533
|
@ -28,3 +28,8 @@ Feature: Provide Sane Defaults for Partial Behavior
|
|||
Given the Server is running at "partials-app"
|
||||
When I go to "/sub/index.html"
|
||||
Then I should see "Local Partial"
|
||||
|
||||
Scenario: Partials can be passed locals
|
||||
Given the Server is running at "partials-app"
|
||||
When I go to "/locals.html"
|
||||
Then I should see "Local var is bar"
|
1
fixtures/partials-app/source/_locals.erb
Normal file
1
fixtures/partials-app/source/_locals.erb
Normal file
|
@ -0,0 +1 @@
|
|||
Local var is <%= foo %>
|
1
fixtures/partials-app/source/locals.html.erb
Normal file
1
fixtures/partials-app/source/locals.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= partial 'locals', :locals => { :foo => 'bar' } %>
|
|
@ -57,9 +57,11 @@ module Middleman::CoreExtensions::Rendering
|
|||
end
|
||||
|
||||
# Sinatra/Padrino render method signature.
|
||||
def render(engine, data, options={}, locals={}, &block)
|
||||
def render(engine, data, options={}, &block)
|
||||
data = data.to_s
|
||||
|
||||
locals = options[:locals]
|
||||
|
||||
found_partial = false
|
||||
engine = nil
|
||||
|
||||
|
|
Loading…
Reference in a new issue