Commit 6c2cfa85 authored by Igor Drozdov's avatar Igor Drozdov

Use ActionController::Base#render_to_string for view rendering

parent 76c7708b
...@@ -85,8 +85,7 @@ module MergeRequests ...@@ -85,8 +85,7 @@ module MergeRequests
end end
def render_template(file:, locals:) def render_template(file:, locals:)
view = ActionView::Base.new(ActionController::Base.view_paths, {}) ActionController::Base.new.render_to_string(template: file, locals: locals)
view.render(file: file, locals: locals)
end end
def can_create_merge_request?(source_branch) def can_create_merge_request?(source_branch)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment