Sha256: 26a93a769d9384c879eb12d9bc9a2e2ff18d46d33104e257d8bc67810bf78ee4

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

class CustomTemplatesController < ApplicationController
  
  layout nil
  # Deprecated, not needed anymore.
  # session :off
  
  caches_page :xslt
  
  def stylesheets
    render_template('css', 'text/css')
  end
  
  def xslt
    render_template('xslt', 'application/xml')
  end
  
  private
  
  def render_template(type, mime_type)
    template = CustomTemplate.find(:first, :conditions => { :name => params[:id], :template_type => type })
    if(template)
      render(:text => template.content, :content_type => mime_type)
    else
      render(:nothing => true, :status => 404)
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
talia_core-0.7.0 generators/talia_base/templates/app/controllers/custom_templates_controller.rb