class AbstractResourceController < ApplicationController 
  protect_from_forgery :only => [] 

  def http_method_dispatch 
    send request.env['REQUEST_METHOD'].downcase 
  end 

  [:get, :post, :put, :delete].each do |http_method| 
    define_method(http_method) { 
      # w klasach pochodnych naley t metod przedefiniowa 
      render :text => "Forbidden", :status => "405 Not Allowed" 
  end 
end 

