Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Width option for dashboard section #1137

Closed
wants to merge 1 commit into from

2 participants

@flskif

If :width option passed - render td with width attribute.

Allows to do this:

section :statistics, :width => 400 do
  div do
    render "pie_chart"
  end
end

This will render <td width="400">%section code%</td>

@flskif flskif :width option for dashboard section
If :width option passed - render ```td``` with ```width``` attribute
e172809
@acurley acurley referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@pcreux
Collaborator

Hello @flskif, Dashboards are now deprecated. :)

Thanks for your PR, sorry for not merging it earlier.

@pcreux pcreux closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 15, 2012
  1. @flskif

    :width option for dashboard section

    flskif authored
    If :width option passed - render ```td``` with ```width``` attribute
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/active_admin/views/pages/dashboard.rb
View
6 lib/active_admin/views/pages/dashboard.rb
@@ -25,8 +25,10 @@ def render_sections(sections)
sections.in_groups_of(3, false).each do |row|
tr do
row.each do |section|
- td do
- render_section(section)
+ if section.options[:width]
+ td :width => section.options[:width] { render_section(section) }
+ else
+ td { render_section(section) }
end
end
end
Something went wrong with that request. Please try again.