lib/scaffolding_extensions/controller/sinatra.rb
# Render's the scaffolded template.  A user can override both the template and the layout.
Render's the scaffolded template.  A user can override both the template and the layout.
Render ' s the scaffolded template . A user can override both the template and 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)
          use_js = @scaffold_javascript
          response['Content-Type'] = 'text/javascript' if use_js
          render(:erb, render_options[:inline], :layout=>false)
        else
          views_path = render_options.delete(:views) || self.class.views || "./views"
          views_dir = Dir.new(views_path) rescue nil
          template = scaffold_template_code(views_dir, suffix_action, action)
          layout_file = settings.send(:erb)[:layout] if settings.respond_to?(:erb)
          layout_file ||= :layout
          layout = scaffold_template_code(views_dir, layout_file, 'layout'){|s| s.gsub('@content', 'yield')}
          render(:erb, template, :layout=>layout)
        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 ) use_js = @scaffold_javascript response [ 'Content-Type' ] = 'text/javascript' if use_js render ( :erb , render_options [ :inline ] , :layout => false ) else views_path = render_options . delete ( :views ) || self . class . views || "./views" views_dir = Dir . new ( views_path ) rescue nil template = scaffold_template_code ( views_dir , suffix_action , action ) layout_file = settings . send ( :erb ) [ :layout ] if settings . respond_to? ( :erb ) layout_file ||= :layout layout = scaffold_template_code ( views_dir , layout_file , 'layout' ) { | s | s . gsub ( '@content' , 'yield' ) } render ( :erb , template , :layout => layout ) end end
Render's the scaffolded template.
Render ' s the scaffolded template .
action
<not_specific>
options
<not_specific>
render_options
<not_specific>