foreman_pipeline / app / lib / foreman_pipeline / api / rendering.rb @ be52ca64
1 |
module ForemanPipeline |
---|---|
2 |
module Api |
3 |
module Rendering |
4 |
|
5 |
def respond_with_template(action, resource_name, options = {}, &block) |
6 |
yield if block_given? |
7 |
status = options[:status] || 200 |
8 |
|
9 |
render :template => "foreman_pipeline/api/#{resource_name}/#{action}", |
10 |
:status => status,
|
11 |
:locals => { :object_name => options[:object_name], |
12 |
:root_name => options[:root_name] }, |
13 |
:layout => "katello/api/v2/layouts/#{options[:layout]}" |
14 |
end
|
15 |
|
16 |
end
|
17 |
end
|
18 |
end
|