Sha256: 52a3feb5d978b949c8d519c3ccdefb916503b24e134c5839efd37f6e77609b38
Contents?: true
Size: 575 Bytes
Versions: 10
Compression:
Stored size: 575 Bytes
Contents
<%- first_attribute = attributes.first -%> class View<%= plural_class_name %>Controller < ApplicationController def index @<%= plural_name %> = <%= class_name %>.page(params[:search], params[:page]) end def show if <%= class_name %>.find_by_<%= first_attribute.name %>(params[:filename]) == nil @<%= singular_name %> = <%= class_name %>.find(:first) render :file => "#{RAILS_ROOT}/public/404.html", :layout => false, :status => 404 else @<%= singular_name %> = <%= class_name %>.find_by_<%= first_attribute.name %>(params[:filename]) end end end
Version data entries
10 entries across 10 versions & 1 rubygems