module RestRails

Constants

VERSION

Public Class Methods

configure() { |self| ... } click to toggle source
# File lib/rest_rails.rb, line 12
def self.configure
  yield self
end
path_for(ar_obj) click to toggle source
# File lib/rest_rails.rb, line 16
def self.path_for(ar_obj)
  root_path = RestRails::Engine.mounted_path
  table = ar_obj.class.table_name
  return "#{root_path}/#{table}" if ar_obj.id.nil?
  return "#{root_path}/#{table}/#{ar_obj.id}"
end