lib/scaffolding_extensions/controller/camping.rb
# In order to override the default templates, you need to set 
# @scaffold_template_dir and then create a template file inside that
# to override the template (make sure the default templates are also
# in this folder). It doesn't support user modifiable layouts,
# so you'll have to modify the layout.rhtml file in @scaffold_template_dir.
In order to override the default templates, you need to set
In order to override the default templates you need to set
def scaffold_render_template(action, options = {}, render_options = {})
        suffix = options[:suffix]
        suffix_action = "#{action}#{suffix}"
        @scaffold_options ||= options
        @scaffold_suffix ||= suffix
        @scaffold_class ||= @scaffold_options[:class]
        if render_options.include?(:inline)
          headers = {}
          headers['Content-Type'] = 'text/javascript' if @scaffold_javascript
          r(200, ERB.new(render_options[:inline]).result(binding), headers)
        else
          @content = ERB.new(File.read(scaffold_path(File.exists?(scaffold_path(suffix_action)) ? suffix_action : action))).result(binding)
          ERB.new(File.read(scaffold_path('layout'))).result(binding)
        end
      end
def scaffold_render_template ( action , options = { } , render_options = { } ) suffix = options [ :suffix ] suffix_action = "#{action}#{suffix}" @scaffold_options ||= options @scaffold_suffix ||= suffix @scaffold_class ||= @scaffold_options [ :class ] if render_options . include? ( :inline ) headers = { } headers [ 'Content-Type' ] = 'text/javascript' if @scaffold_javascript r ( 200 , ERB . new ( render_options [ :inline ] ) . result ( binding ) , headers ) else @content = ERB . new ( File . read ( scaffold_path ( File . exists? ( scaffold_path ( suffix_action ) ) ? suffix_action : action ) ) ) . result ( binding ) ERB . new ( File . read ( scaffold_path ( 'layout' ) ) ) . result ( binding ) end end
In order to override the default templates, you need to set
In order to override the default templates you need to set
action
<not_specific>
options
<not_specific>
render_options
<not_specific>
scaffold_template_dir
and then create a template file inside that to override the template (make sure the default templates are also in this folder). It doesn't support user modifiable layouts, so you'll have to modify the layout.rhtml file in @scaffold_template_dir.
and then create a template file inside that to override the template ( make sure the default templates are also in this folder ) . It doesn ' t support user modifiable layouts so you ' ll have to modify the layout . rhtml file in @scaffold_template_dir .