Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## environment.rb
- Rails::Initializer.run do |config|
- ...
- end
- def require_widget(*widgets)
- widgets.each do |widget|
- require_dependency "widgets/#{widget.to_s}_widgets"
- end
- ## ApplicationController
- class ApplicationController < ActionController::Base
- require_widget [:funny]
- include FunnyWidgets
- def index
- ....
- end
- end
Add Comment
Please, Sign In to add comment