lib/generators/templates/app/controllers/base.rb in beautiful_scaffold-0.1.9 vs lib/generators/templates/app/controllers/base.rb in beautiful_scaffold-0.2.0
- old
+ new
@@ -1,9 +1,11 @@
# encoding : utf-8
class <%= namespace_for_class %><%= model_camelize.pluralize %>Controller < BeautifulController
- # Official Rails version : master/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
before_filter :load_<%= model %>, :only => [:show, :edit, :update, :destroy]
+
+ # Uncomment for check abilities with CanCan
+ #authorize_resource
def index
session[:fields] ||= {}
session[:fields][:<%= model %>] ||= (<%= model_camelize %>.columns.map(&:name) - ["id"])[0..4]
do_select_fields(:<%= model %>)