lib/scaffolding_extensions/controller/action_controller.rb
# Renders user provided template if it exists, otherwise renders a scaffold template.
# If a layout is specified (either in the controller or as an render_option), use that layout,
# otherwise uses the scaffolded layout.  If :inline is one of the render_options,
# use the contents of it as the template without the layout.
Renders user provided template if it exists, otherwise renders a scaffold template.
If a layout is specified (either in the controller or as an render_option), use that layout,
otherwise uses the scaffolded layout.  If :inline is one of the render_options,
use the contents of it as the template without the layout.
Renders user provided template if it exists otherwise renders a scaffold template . If a layout is specified ( either in the controller or as an render_option ) use that layout otherwise uses the scaffolded layout . If : inline is one of the render_options use the contents of it as the template without the layout .
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['Content-Type'] = 'text/javascript' if @scaffold_javascript
          return render(render_options.merge(:layout=>false))
        end
        begin
          render({:action=>suffix_action}.merge(render_options))
        rescue ActionView::MissingTemplate
          if render_options.include?(:layout) || _default_layout
            render({:file=>scaffold_path(action)}.merge(render_options))
          else
            options = _normalize_args({:file=>scaffold_path(action)}.merge(render_options))
            _normalize_options(options)
            _process_options(options)
            vc = view_context
            @content = vc.render(options)
            vc.instance_variables.each{|iv| instance_variable_set(iv, vc.instance_variable_get(iv))}
            render({:file=>scaffold_path("layout")})
          end
        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 [ 'Content-Type' ] = 'text/javascript' if @scaffold_javascript return render ( render_options . merge ( :layout => false ) ) end begin render ( { :action => suffix_action } . merge ( render_options ) ) rescue ActionView :: MissingTemplate if render_options . include? ( :layout ) || _default_layout render ( { :file => scaffold_path ( action ) } . merge ( render_options ) ) else options = _normalize_args ( { :file => scaffold_path ( action ) } . merge ( render_options ) ) _normalize_options ( options ) _process_options ( options ) vc = view_context @content = vc . render ( options ) vc . instance_variables . each { | iv | instance_variable_set ( iv , vc . instance_variable_get ( iv ) ) } render ( { :file => scaffold_path ( "layout" ) } ) end end end
Renders user provided template if it exists, otherwise renders a scaffold template.
Renders user provided template if it exists otherwise renders a scaffold template .
action
<not_specific>
options
<not_specific>
render_options
<not_specific>