Methods

Files

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 137
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.