Skip to content

Instantly share code, notes, and snippets.

@mxrguspxrt
Created December 23, 2011 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxrguspxrt/1514304 to your computer and use it in GitHub Desktop.
Save mxrguspxrt/1514304 to your computer and use it in GitHub Desktop.
# atm its so for my class
class ApplicationController < ActionController::Base
extend ActiveSupport::Concern
protect_from_forgery
#enable_authorization
respond_to :html, :xml, :json
def self.inherited base
# Inherited resources fix
throw base
end
end
# How could I write it similar to https://github.com/rails/rails/blob/master/activesupport/lib/active_support/concern.rb ? "extended do" or smth similar, so it would be more pretty for the eyes
# Smth similar to:
class ApplicationController < ActionController::Base
extend ActiveSupport::Concern
protect_from_forgery
#enable_authorization
respond_to :html, :xml, :json
extended do
# Inherited resources fix
throw self
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment