fabrik42/acts_as_api — pull request #38 by vizjerai (2011-10-10 18:42:40+00:00)
Title: Add Prefix and Postfix Support

Added support for specifying a prefix and/or postfix for the name of a template.

This allows support for versioning or namespacing without having to redefine the api_template method.

prefix:

# controller
render :api_template => :public, :api_prefix => :v1

# model
api_accessible :v1_public do |t|
# ...
end

postfix:

# controller
render :api_template => :public, :api_postfix => :v1

# model
api_accessible :public_v1 do |t|
# ...
end

prefix and postfix:

# controller
render :api_template => :public, :api_prefix => :v1, :api_postfix => :v2

# model
api_accessible :v1_public_v2 do |t|
# ...
end