Skip to content

Instantly share code, notes, and snippets.

@jmercedes
Last active December 10, 2015 05:08
Show Gist options
  • Save jmercedes/4385769 to your computer and use it in GitHub Desktop.
Save jmercedes/4385769 to your computer and use it in GitHub Desktop.
<%= @bios.inspect %>
1.9.3-p125 :001 > Refinery::Page.where(view_template: :bio)
Refinery::Page Load (0.4ms) SELECT "refinery_pages".* FROM "refinery_pages" WHERE "refinery_pages"."view_template" = 'bio'
Refinery::Page::Translation Load (0.2ms) SELECT "refinery_page_translations".* FROM "refinery_page_translations" WHERE "refinery_page_translations"."refinery_page_id" = 23
=> [#<Refinery::Page id: 23, parent_id: nil, path: nil, slug: "bio", show_in_menu: true, link_url: "", menu_match: nil, deletable: true, draft: false, skip_to_first_child: false, lft: 35, rgt: 36, depth: 0, view_template: "bio", layout_template: nil, created_at: "2012-12-27 06:51:31", updated_at: "2012-12-27 06:59:12">]
1.9.3-p125 :002 >
Refinery::PagesController.class_eval do
before_filter :find_all_bios, only: [:bio]
protected
def find_all_bios
@bios = Refinery::Page.where(view_template: :bio)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment