<%- first_attribute = model_attributes.first -%> module FrontEnd class App::<%= plural_class_name %>Controller < ApplicationController def index @<%= plural_name %> = ::App::<%= class_name %>.page(params[:search], params[:page]) end def show @<%= singular_name %> = ::App::<%= class_name %>.find_by_<%= first_attribute.name %>(params[:filename]) if @<%= singular_name %> == nil render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404 else @<%= singular_name %> end end end end