Sha256: 7efac16db99f128cbba70bd72cc8a7e53730ed16eb304eb4bf9f601731928e3d

Contents?: true

Size: 1.03 KB

Versions: 34

Compression:

Stored size: 1.03 KB

Contents

module ControllerHelper
  def get(action, parameters = nil, session = nil, flash = nil)
    process_action(action, parameters, session, flash, "GET")
  end

  # Executes a request simulating POST HTTP method and set/volley the response
  def post(action, parameters = nil, session = nil, flash = nil)
    process_action(action, parameters, session, flash, "POST")
  end

  # Executes a request simulating PUT HTTP method and set/volley the response
  def put(action, parameters = nil, session = nil, flash = nil)
    process_action(action, parameters, session, flash, "PUT")
  end

  # Executes a request simulating DELETE HTTP method and set/volley the response
  def delete(action, parameters = nil, session = nil, flash = nil)
    process_action(action, parameters, session, flash, "DELETE")
  end

  private

    def process_action(action, parameters = nil, session = nil, flash = nil, method = "GET")
      parameters ||= {}
      process(action, parameters.merge!(:use_route => Sunrise::Engine.engine_name), session, flash, method)
    end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
sunrise-cms-1.0.0.rc2 spec/support/helpers/controller_helper.rb
sunrise-cms-1.0.0.rc1 spec/support/helpers/controller_helper.rb
sunrise-cms-0.7.0.rc2 spec/support/helpers/controller_helper.rb
sunrise-cms-0.7.0.rc1 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.11 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.10 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.9 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.8 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.7 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.6 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.5 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.4 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.3 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.2 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.1 spec/support/helpers/controller_helper.rb
sunrise-cms-0.6.0 spec/support/helpers/controller_helper.rb
sunrise-cms-0.5.3 spec/support/helpers/controller_helper.rb
sunrise-cms-0.5.2 spec/support/helpers/controller_helper.rb
sunrise-cms-0.5.1 spec/support/helpers/controller_helper.rb
sunrise-cms-0.5.0 spec/support/helpers/controller_helper.rb