Sha256: 6b66263aee18fdc693b00e1dcecbfeb7ad61812e25cb9799df3a356b66d972a6
Contents?: true
Size: 967 Bytes
Versions: 9
Compression:
Stored size: 967 Bytes
Contents
module Brakeman::RouteHelper #Manage Controller prefixes #@prefix is an Array, but this method returns a string #suitable for prefixing onto a controller name. def prefix if @prefix.length > 0 @prefix.join("::") << "::" else '' end end #Sets the controller name to a proper class name. #For example # self.current_controller = :session # @controller == :SessionController #true # #Also prepends the prefix if there is one set. def current_controller= name @current_controller = (prefix + camelize(name) + "Controller").to_sym @tracker.routes[@current_controller] ||= Set.new end #Add default routes def add_resources_routes @tracker.routes[@current_controller].merge [:index, :new, :create, :show, :edit, :update, :destroy] end #Add default routes minus :index def add_resource_routes @tracker.routes[@current_controller].merge [:new, :create, :show, :edit, :update, :destroy] end end
Version data entries
9 entries across 9 versions & 1 rubygems