blob: bc7b55f91ffec2c452cc6784e3abeb2c5f5a42b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
.resource
%h3= "#{h resource.to_s} (#{resource.class})"
%table
- resource.instance_variables.sort.each do |v|
- attr_name = v.gsub(/\@/, "")
- unless attr_name == "collection"
%tr.attr_group
%td.attr_name
= "#{h attr_name}"
- value = resource.instance_variable_get(v)
- if value.kind_of?(String)
%td.attr_value
= "#{h value}"
- elsif value.kind_of?(Array)
%td.attr_value
= "#{h value.join(", ")}"
- elsif value.kind_of?(Symbol)
%td.attr_value
= "#{h value.to_s}"
- else
%td.attr_value
= "#{h value.inspect}"
|