Skip to content

Commit

Permalink
Allow layouts to be overridable. Fixes a regression introduced in #425.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsojes authored and iNecas committed Sep 4, 2016
1 parent 296c097 commit a1013a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tasks/apipie.rake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ namespace :apipie do
else
File.expand_path("../../../app/views/apipie/apipies", __FILE__)
end
layouts_path = File.expand_path("../../../app/views/layouts", __FILE__)
layouts_path = if File.directory?("#{Rails.root}/app/views/layouts/apipie")
"#{Rails.root}/app/views/layouts"
else
File.expand_path("../../../app/views/layouts", __FILE__)
end
@apipie_renderer = ActionView::Base.new([base_path, layouts_path])
@apipie_renderer.singleton_class.send(:include, ApipieHelper)
return @apipie_renderer
Expand Down

0 comments on commit a1013a6

Please sign in to comment.