Permalink
Browse files
fixing render call so it only takes one template argument
- Loading branch information...
Showing
with
6 additions
and
4 deletions.
-
+3
−2
lib/selenium_on_rails/rselenese.rb
-
+3
−2
lib/selenium_on_rails/selenese.rb
|
@@ -20,15 +20,16 @@ def initialize view |
|
|
end
|
|
|
|
|
|
# Render _template_ using _local_assigns_.
|
|
|
- def render template, local_assigns
|
|
|
+ def render template
|
|
|
+ local_assigns = template.locals
|
|
|
title = (@view.assigns['page_title'] or local_assigns['page_title'])
|
|
|
table(title) do
|
|
|
test = self #to enable test.command
|
|
|
|
|
|
assign_locals_code = ''
|
|
|
local_assigns.each_key {|key| assign_locals_code << "#{key} = local_assigns[#{key.inspect}];"}
|
|
|
|
|
|
- eval assign_locals_code + "\n" + template
|
|
|
+ eval assign_locals_code + "\n" + template.source
|
|
|
end
|
|
|
end
|
|
|
|
|
|
|
@@ -8,9 +8,10 @@ def initialize view |
|
|
@view = view
|
|
|
end
|
|
|
|
|
|
- def render template, local_assigns
|
|
|
+ def render template
|
|
|
+ local_assigns = template.locals
|
|
|
name = (@view.assigns['page_title'] or local_assigns['page_title'])
|
|
|
- lines = template.strip.split "\n"
|
|
|
+ lines = template.source.strip.split "\n"
|
|
|
html = ''
|
|
|
html << extract_comments(lines)
|
|
|
html << extract_commands(lines, name)
|
|
|
0 comments on commit
2365102