class View<%=parent_plural_class_name%>Controller < ApplicationController def index @<%=parent_plural_name%> = <%=parent_class_name%>.page(params[:search], params[:page]) end def show if <%=parent_class_name%>.find_by_filename(params[:filename]) == nil @<%=parent_singular_name%> = <%=parent_class_name%>.find(:first) render :file => "#{RAILS_ROOT}/public/404.html", :layout => false, :status => 404 else @<%=parent_singular_name%> = <%=parent_class_name%>.find_by_filename(params[:filename]) @<%=child_plural_name%> = @<%=parent_singular_name%>.<%=child_plural_name%>.<%=parent_singular_name%>_page(params[:page]) end end end