app/views/superconductor/_panel.html.erb in superconductor-0.0.1 vs app/views/superconductor/_panel.html.erb in superconductor-0.0.2
- old
+ new
@@ -20,22 +20,43 @@
<dt>Referer</dt>
<dd><%= request.referer %></dd>
<dt>Format</dt>
<dd><%= request.format %></dd>
</dl>
- <footer />
+ <br />
</details>
</details>
<details open>
<summary>Variables</summary>
<dl>
<% controller.instance_variables.reject { |k| k.to_s.starts_with?('@_') }.map { |k| [k, instance_variable_get(k)] }.each do |k, v| %>
<dt><%= k %></dt>
- <dd><%= v %></dd>
+ <dd>
+ <% if v.is_a?(ActiveRecord::Relation) %>
+ <details>
+ <summary><%= v.klass.name.pluralize %></summary>
+ <dl>
+ <dd><%= v.to_sql %>
+ </dl>
+ </details>
+ <% elsif v.is_a?(ActiveRecord::Base) %>
+ <details>
+ <summary><%= "New " if v.new_record? %><%= v.class.name %></summary>
+ <dl>
+ <% v.attributes.each do |attribute,value| %>
+ <dt><%= attribute %></dt>
+ <dd><%= value %></dd>
+ <% end %>
+ </dl>
+ </details>
+ <% else %>
+ <%= v %>
+ <% end %>
+ </dd>
<% end %>
- <footer />
</dl>
+ <br />
</details>
<details>
<summary>Session</summary>
<dl>
<% session.each do |k,v| %>
@@ -48,15 +69,16 @@
<details>
<% file, lineno = controller.class.instance_method(action_name).source_location %>
<summary>
<%= controller.class.name %>#<%= action_name %>
<a href="edit-source://<%= file %>?<%= lineno %>">Edit Source</a>
- <footer />
+ <br />
</summary>
<%= form_tag superconductor_file_path, :method => :put do %>
<%= hidden_field_tag :file, file %>
<%= text_area_tag :content, File.read(file), :wrap => "off", 'data-line-no' => lineno %>
<% end %>
</details>
<% rescue %>
<% end %>
+ <%= yield %>
</section>