Skip to content

Commit

Permalink
Pass the view paths as array to ActionView::Base.new
Browse files Browse the repository at this point in the history
Rails 6 can't handle Rails::Root::Path itself
  • Loading branch information
coolo committed Nov 23, 2019
1 parent e0f1b6f commit a0c543e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/mixins/can_render_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# and use my_model to access the model instead of self
module CanRenderModel
def render_xml(locals = {})
action_view = ActionView::Base.new(Rails.configuration.paths['app/views'])
action_view = ActionView::Base.new(Rails.configuration.paths['app/views'].to_ary)
locals[:my_model] = self
action_view.render partial: "models/#{self.class.name.underscore}", formats: [:xml],
locals: locals
Expand Down

0 comments on commit a0c543e

Please sign in to comment.