    # File lib/action_controller/scaffolding.rb, line 86
          def scaffold(model_id, options = {})
            options.assert_valid_keys(:class_name, :suffix)

            singular_name = model_id.to_s
            class_name    = options[:class_name] || singular_name.camelize
            plural_name   = singular_name.pluralize
            suffix        = options[:suffix] ? "_#{singular_name}" : ""

            unless options[:suffix]
              module_eval "def index\nlist\nend\n", __FILE__, __LINE__
            end

            module_eval "\nverify :method => :post, :only => [ :destroy\#{suffix}, :create\#{suffix}, :update\#{suffix} ],\n:redirect_to => { :action => :list\#{suffix} }\n\n\ndef list\#{suffix}\n@\#{singular_name}_pages, @\#{plural_name} = paginate :\#{plural_name}, :per_page => 10\nrender\#{suffix}_scaffold \"list\#{suffix}\"\nend\n\ndef show\#{suffix}\n@\#{singular_name} = \#{class_name}.find(params[:id])\nrender\#{suffix}_scaffold\nend\n\ndef destroy\#{suffix}\n\#{class_name}.find(params[:id]).destroy\nredirect_to :action => \"list\#{suffix}\"\nend\n\ndef new\#{suffix}\n@\#{singular_name} = \#{class_name}.new\nrender\#{suffix}_scaffold\nend\n\ndef create\#{suffix}\n@\#{singular_name} = \#{class_name}.new(params[:\#{singular_name}])\nif @\#{singular_name}.save\nflash[:notice] = \"\#{class_name} was successfully created\"\nredirect_to :action => \"list\#{suffix}\"\nelse\nrender\#{suffix}_scaffold('new')\nend\nend\n\ndef edit\#{suffix}\n@\#{singular_name} = \#{class_name}.find(params[:id])\nrender\#{suffix}_scaffold\nend\n\ndef update\#{suffix}\n@\#{singular_name} = \#{class_name}.find(params[:id])\n@\#{singular_name}.attributes = params[:\#{singular_name}]\n\nif @\#{singular_name}.save\nflash[:notice] = \"\#{class_name} was successfully updated\"\nredirect_to :action => \"show\#{suffix}\", :id => @\#{singular_name}\nelse\nrender\#{suffix}_scaffold('edit')\nend\nend\n\nprivate\ndef render\#{suffix}_scaffold(action=nil)\naction ||= caller_method_name(caller)\n# logger.info (\"testing template:\" + \"\\\#{self.class.controller_path}/\\\#{action}\") if logger\n\nif template_exists?(\"\\\#{self.class.controller_path}/\\\#{action}\")\nrender :action => action\nelse\n@scaffold_class = \#{class_name}\n@scaffold_singular_name, @scaffold_plural_name = \"\#{singular_name}\", \"\#{plural_name}\"\n@scaffold_suffix = \"\#{suffix}\"\nadd_instance_variables_to_assigns\n\n@template.instance_variable_set(\"@content_for_layout\", @template.render_file(scaffold_path(action.sub(/\#{suffix}$/, \"\")), false))\n\nif !active_layout.nil?\nrender :file => active_layout, :use_full_path => true\nelse\nrender :file => scaffold_path('layout')\nend\nend\nend\n\ndef scaffold_path(template_name)\nFile.dirname(__FILE__) + \"/templates/scaffolds/\" + template_name + \".rhtml\"\nend\n\ndef caller_method_name(caller)\ncaller.first.scan(/`(.*)'/).first.first # ' ruby-mode\nend\n", __FILE__, __LINE__
          end