Module: Padrino::Rendering::InstanceMethods

### Home Classes Methods

### In Files

- lib/padrino-core/application/rendering.rb

### Methods

- #content_type

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Application
- Padrino::ApplicationLoadError
- Padrino::ApplicationSetupError
- Padrino::Cli
- Padrino::Cli::Adapter
- Padrino::Cli::Base
- Padrino::Erubis
- Padrino::Erubis::SafeBufferEnhancer
- Padrino::Erubis::SafeBufferTemplate
- Padrino::Erubis::Template
- Padrino::Filter
- Padrino::Flash
- Padrino::Flash::Helpers
- Padrino::Flash::Storage
- Padrino::Logger
- Padrino::Logger::Colorize
- Padrino::Logger::Extensions
- Padrino::Logger::Rack
- Padrino::Module
- Padrino::Mounter
- Padrino::Mounter::MounterException
- Padrino::Reloader
- Padrino::Reloader::Rack
- Padrino::Rendering
- Padrino::Rendering::ClassMethods
- Padrino::Rendering::InstanceMethods
- Padrino::Rendering::SafeTemplate
- Padrino::Rendering::TemplateNotFound
- Padrino::Router
- Padrino::Routing
- Padrino::Routing::ClassMethods
- Padrino::Routing::InstanceMethods
- Padrino::Routing::Parent
- Padrino::Routing::UnrecognizedException
- Padrino::Server
- Padrino::ShowExceptions
- Padrino::Tasks
- Padrino::Utils
- HttpRouter
- HttpRouter::Node
- HttpRouter::Node::Path
- HttpRouter::Request
- HttpRouter::Route
- Haml
- Haml::Helpers
- Haml::Util
- Sinatra
- Sinatra::Request
- Slim
- Slim::Template
- Tilt
- Tilt::HamlTemplate
- FileSet
- Kernel
- Module
- Object
- ObjectSpace
- PadrinoTasks
- String
- SupportLite

No matching classes.

# Padrino::Rendering::InstanceMethods

Instance methods that allow enhanced rendering to function properly in Padrino.

### Attributes

current_engine[R]

### Public Instance Methods

content_type(type=nil, params={}) click to toggle source

Get/Set the content_type

@param [String, nil] type

    The Content-Type to use.

@param [Symbol, nil] type.

    Look and parse the given symbol to the matched Content-Type.

@param [Hash] params

    Additional params to append to the Content-Type.

@example

    case content_type
      when :js then do_some
      when :css then do_another
    end

    content_type :js
    # => set the response with 'application/javascript' Content-Type
    content_type 'text/html'

    # => set directly the Content-Type to 'text/html'

    # File lib/padrino-core/application/rendering.rb, line 162
    def content_type(type=nil, params={})
      unless type.nil?
        super(type, params)
        @_content_type = type
      end
      @_content_type
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.