Guest User

Untitled

a guest
May 27th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1.  
  2. ## environment.rb
  3.  
  4. Rails::Initializer.run do |config|
  5. ...
  6. end
  7.  
  8.  
  9. def require_widget(*widgets)
  10. widgets.each do |widget|
  11. require_dependency "widgets/#{widget.to_s}_widgets"
  12. end
  13.  
  14.  
  15. ## ApplicationController
  16. class ApplicationController < ActionController::Base
  17. require_widget [:funny]
  18. include FunnyWidgets
  19. def index
  20. ....
  21. end
  22. end
Add Comment
Please, Sign In to add comment