view = ActionView::Base.new(ActionController::Base.view_paths, {}, ActionController::Base.new)
# works fine
puts view.render(file: 'books/index')
# doesn't work
puts view.render('books/index', layout: 'application')
ActionView::MissingTemplate: Missing partial books/_index with {:locale=>[:en], :formats=>[:html, :text, :js, :css, :ics, :csv, :vcf, :png, :jpeg, :gif, :bmp, :tiff, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:
And it doesn't work when there is user_signed_in?
in view (view.render(file: 'books/index')
).
ActionView::Template::Error: undefined method `user_signed_in?' for #