Sha256: 6bb192f61d4721561b2d3e3ab052cbaf51c21d5a0a2c8c88ed135390639b69af
Contents?: true
Size: 727 Bytes
Versions: 15
Compression:
Stored size: 727 Bytes
Contents
class String def extract_settings split(",").map(&:strip) end def remove_prefix split("/")[1..-1].join("/") end def extract_class remove_prefix.classify.constantize end def extract_singular_class remove_prefix.camelize.constantize end # CRUD: create, read, update, delete # Read more at http://en.wikipedia.org/wiki/Create,_read,_update_and_delete def acl_action_mapper case self when "new", "create" "create" when "index", "show" "read" when "edit", "update", "position", "toggle", "relate", "unrelate" "update" when "destroy", "trash" "delete" else self end end def to_resource self.underscore.pluralize end end
Version data entries
15 entries across 15 versions & 2 rubygems