Sha256: 8589fd20825efc0ec4cdabab59ebff9b16e6f165423209f88644b985f0d4fbe0

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

# encoding: utf-8


class Caterpillar::HttpMethodsController < Caterpillar::ApplicationController

  def post
    @postcode = 'SW1A 0AA'

    if request.post?
      @msg      = params[:msg]
      @checkbox = params[:checkbox]
      if params[:postcode]
        @msg = params[:postcode][@postcode]
      end
	  if params[:'_encoding_']
	    @msg << " with IE hack"
	  end
    end
 
    render :action => :post
  end

  def post_and_redirect
    @msg      = '"%s" passed from POST to GET' % params[:msg_get] if request.get? and params[:msg_get]
    if request.post?
      redirect_to :action => :post_and_redirect, :msg_get => params[:msg]
    end
  end

  def parameter
    @params = params
    @params.delete :action
    @params.delete :controller
  end

  def redirect_back
    redirect_to :back
  end

  def redirect_action
    flash[:info] = 'This message was set in the action before redirect'
    redirect_to :action => :redirect, :x => true
  end

#   def redirect_target
#     render :action => :redirect
#   end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
caterpillar-1.6.0 portlet_test_bench/controllers/caterpillar/http_methods_controller.rb
caterpillar-1.4.4 portlet_test_bench/controllers/caterpillar/http_methods_controller.rb
caterpillar-1.4.3 portlet_test_bench/controllers/caterpillar/http_methods_controller.rb
caterpillar-1.4.2 portlet_test_bench/controllers/caterpillar/http_methods_controller.rb
caterpillar-1.4.1 portlet_test_bench/controllers/caterpillar/http_methods_controller.rb
caterpillar-1.4.0 portlet_test_bench/controllers/caterpillar/http_methods_controller.rb