Module: Padrino::Rendering::InstanceMethods

### Home Classes Methods

### In Files

- lib/padrino/rendering.rb

### Methods

- #content_type

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Helpers
- Padrino::Helpers::AssetTagHelpers
- Padrino::Helpers::FormBuilder
- Padrino::Helpers::FormBuilder::AbstractFormBuilder
- Padrino::Helpers::FormBuilder::DeprecatedBuilderMethods
- Padrino::Helpers::FormBuilder::StandardFormBuilder
- Padrino::Helpers::FormHelpers
- Padrino::Helpers::FormHelpers::Errors
- Padrino::Helpers::FormHelpers::Options
- Padrino::Helpers::FormHelpers::Security
- Padrino::Helpers::NumberHelpers
- Padrino::Helpers::OutputHelpers
- Padrino::Helpers::OutputHelpers::AbstractHandler
- Padrino::Helpers::OutputHelpers::ErbHandler
- Padrino::Helpers::OutputHelpers::HamlHandler
- Padrino::Helpers::OutputHelpers::SinatraCurrentEngine
- Padrino::Helpers::OutputHelpers::SlimHandler
- Padrino::Helpers::RenderHelpers
- Padrino::Helpers::TagHelpers
- Padrino::Helpers::TranslationHelpers
- Padrino::Rendering
- Padrino::Rendering::ClassMethods
- Padrino::Rendering::ErubisTemplate
- Padrino::Rendering::HamlTemplate
- Padrino::Rendering::InstanceMethods
- Padrino::Rendering::SafeBufferEnhancer
- Padrino::Rendering::SafeEruby
- Padrino::Rendering::SafeTemplate
- Padrino::Rendering::SlimTemplate
- Padrino::Rendering::TemplateNotFound
- Haml
- Haml::Helpers
- Haml::Util

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/rendering.rb, line 190
    def content_type(type=nil, params={})
      if type
        super(type, params)
        @_content_type = type
      end
      @_content_type
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.