Sha256: 7818bb433f7807ee47b8e2dde44a06cadcca76cb2c1ed6f68cea48c68373dff6
Contents?: true
Size: 832 Bytes
Versions: 8
Compression:
Stored size: 832 Bytes
Contents
class <%= class_name.pluralize %>Controller < ApplicationController before_filter :find_all_<%= plural_name %> before_filter :find_page def index # you can use meta fields from your model instead (e.g. browser_title) # by swapping @page for @<%= singular_name %> in the line below: present(@page) end def show @<%= singular_name %> = <%= class_name %>.find(params[:id]) # you can use meta fields from your model instead (e.g. browser_title) # by swapping @page for @<%= singular_name %> in the line below: present(@page) end protected def find_all_<%= plural_name %> @<%= "all_" if plural_name == singular_name %><%= plural_name %> = <%= class_name %>.find(:all, :order => "position ASC") end def find_page @page = Page.find_by_link_url("/<%= plural_name %>") end end
Version data entries
8 entries across 8 versions & 1 rubygems