Fixes deprecation warning about passing a template handler

in the template name while generating guide related pages
like index, layout and credits
This commit is contained in:
Vijay Dev
2011-11-10 22:36:20 +05:30
parent 80f96ebcf5
commit 74233d48e6

View File

@@ -137,7 +137,8 @@ module RailsGuides
if guide =~ /\.html\.erb$/
# Generate the special pages like the home.
result = view.render(:layout => 'layout', :file => guide)
# Passing a template handler in the template name is deprecated. So pass the file name without the extension.
result = view.render(:layout => 'layout', :file => $`)
else
body = File.read(File.join(source_dir, guide))
body = set_header_section(body, view)