Skip to content

Instantly share code, notes, and snippets.

@mikepence
Created December 16, 2012 22:23
Show Gist options
  • Save mikepence/4313683 to your computer and use it in GitHub Desktop.
Save mikepence/4313683 to your computer and use it in GitHub Desktop.
class PlacardPanelWidget < Apotomo::Widget
has_widgets do
self << widget(:project_placard, 'project_1')
self << widget(:project_placard, 'project_2')
self << widget(:project_placard, 'project_3')
self << widget(:project_placard, 'project_4')
end
def display
@title = options[:title]
@locale = options[:locale]
@projects = options[:projects]
render
end
end
# in the template...
<%= render_widget :project_1, :display, :project => @projects[0] %>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment