public
Description: Include stylesheets and scripts in a before_filter-esque fashion, and set up simple memoized methods for record fetches.
Homepage: http://www.mbleigh.com/plugins/needy-controllers-drying-stylesheets-scripts-and-fetching
Clone URL: git://github.com/mbleigh/needy-controllers.git
needy-controllers / init.rb
100644 20 lines (14 sloc) 0.663 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'intridea/needy_controllers'
 
ActionController::Base.send :include, Intridea::StyleChain
ActionView::Base.send :include, Intridea::StyleChain::Helpers
 
ActionController::Base.send :include, Intridea::BehaviorChain
 
ActionView::Base.send :include, Intridea::BehaviorChain::Helpers
ActionView::Base.send :alias_method_chain, :javascript_include_tag, :needs
 
ActionController::Base.send :include, Intridea::NeedyControllers
 
ActionView::Base.send :include, Intridea::NeedyControllers::Helpers
ActionView::Base.send :alias_method_chain, :stylesheet_link_tag, :needs
 
class ActiveRecord::Base
  def self.from_param(parameter)
    find(parameter.to_i)
  end
end