Input form for creation
Input form for creation
Strong parameter definitions for creation form
Strong parameter definitions for creation form
SkinnyModel for this resource.
SkinnyModel for this resource.
Resource name in the singular.
Resource name in the singular. This name will be used for path and validator's prefix.
Resource name in the plural.
Resource name in the plural. This name will be used for path and directory name to locale template files.
Input form for modification
Input form for modification
Strong parameter definitions for modification form
Strong parameter definitions for modification form
Note: Same action method name should be registered several times.
Note: Same action method name should be registered several times. For example, put("/members/:id")(...).as('update) and patch("/members/:id")(...).as('update).
Adds action definition
Add param to params in the request scope.
Override to append HTTP method information to Route objects.
Override to append HTTP method information to Route objects.
Registers afterAction to this controller.
Registers afterAction to this controller.
this action should be applied only for these action methods
this action should not be applied for these action methods
action
If you prefer #afterFilter than #afterAction, keep going!
If you prefer #afterFilter than #afterAction, keep going!
Awaits multiple Future's results.
Awaits multiple Future's results.
duration to await futures
futures
execution context
results
Registers beforeAction to this controller.
Registers beforeAction to this controller.
this action should be applied only for these action methods
this action should not be applied for these action methods
action
If you prefer #beforeFilter than #beforeAction, keep going!
If you prefer #beforeFilter than #beforeAction, keep going!
Default charset.
Default charset.
Creates skinny.
Creates skinny.I18n instance for current locale.
current locale
i18n provider
Params for creation.
Params for creation.
Creates new resource.
Creates new resource.
POST /{resources}
format
created response if success
Returns action name for this request.
Returns current locale for this request.
Returns current locale for this request.
current locale
Outputs debug logging for passed parameters.
Outputs debug logging for passed parameters.
input form
id if exists
Outputs debug logging for permitted parameters.
Outputs debug logging for permitted parameters.
permitted strong parameters
id if exists
Returns default locale.
Returns default locale.
Destroys the specified resource.
Destroys the specified resource.
DELETE /{resources}/{id}
id
format
result
Executes resource creation.
Executes resource creation.
permitted parameters
generated resource id
Executes deletion of the specified single resource.
Executes deletion of the specified single resource.
id
count
Executes modification for the specified resource.
Executes modification for the specified resource.
id
permitted parameters
count
Returns errorMessages in the RequestScope.
Returns errorMessages in the RequestScope.
Creates a future with implicit request.
Creates a future with implicit request.
response type
operation inside this future
execution context
request
response value
Fetches value from request scope.
Fetches value from request scope.
type
key
value if exists
Halts with body which responds to the specified format.
Halts with body which responds to the specified format.
response type
http status
format (HTML,JSON,XML...)
body if possible
Id field name.
Id field name.
Id parameter name.
Id parameter name.
Predicates current env is "development" or "dev".
Replaces Scalatra's development mode with SkinnyEnv.
Replaces Scalatra's development mode with SkinnyEnv.
Predicates current env is "production" or "prod".
Predicates current env is "staging" or "qa".
Predicates current env is "test".
Returns keyAndErrorMessages in the RequestScope.
Returns keyAndErrorMessages in the RequestScope.
Normalized base path.
Normalized base path. This method should not be overridden.
Responds as "301 Moved Permanently"
Responds as "302 Found"
Responds as "303 See Other"
Renders body which responds to the specified format (JSON, XML) if possible.
Renders body which responds to the specified format (JSON, XML) if possible.
entity
format (HTML,JSON,XML...)
body if possible
Set attributes to request scope.
Set attributes to request scope.
collection of key and value.
self
Set attribute to request scope.
Set attribute to request scope.
key and value
self
Returns whole request scope attributes.
Returns whole request scope attributes.
whole attributes
Base path.
Base path.
Base path prefix.
Base path prefix. (e.g. /admin/{resourcesName} )
Defines formats to be respond.
Defines formats to be respond. By default, HTML, JSON, XML are available.
formats
Returns JSON response.
Returns JSON response.
entity
charset
prettify if true
body
to enable params.
to enable params.getAs[Id]("id")
Returns registered sensitive parameter names.
Returns registered sensitive parameter names.
Session key to store current locale string.
Set attributes to request scope.
Set attributes to request scope.
Set attribute to request scope.
Set attribute to request scope.
Set params which is generated from a model object using Java reflection APIs.
Set params which is generated from a model object using Java reflection APIs.
model instance
Set Content-Type response header which is suitable for specified extension.
Set Content-Type response header which is suitable for specified extension.
Set Content-Type for the format if absent.
Set Content-Type for the format if absent.
format
Set current locale.
Set {{skinny.
Set {{skinny.I18n}} object for the current request to request scope.
current locale
self
Set params to request scope.
Set params to request scope.
Set params to request scope.
Set params to request scope.
Show single resource.
Show single resource.
GET /{resources}/{id} GET /{resources}/{id}.xml GET /{resources}/{id}.json
id
format
single resource
Shows a list of resource.
Shows a list of resource.
GET /{resources}/ GET /{resources}/?pageNo=1&pageSize=10 GET /{resources} GET /{resources}.xml GET /{resources}.json
format
list of resource
Pass this controller instance implicitly because skinny.routing.implicits.RoutesAsImplicits expects skinny.controller.SkinnyControllerBase.
Pass this controller instance implicitly because skinny.routing.implicits.RoutesAsImplicits expects skinny.controller.SkinnyControllerBase.
Env string value from "skinny.
Env string value from "skinny.env" or "org.scalatra.environment".
env string such as "production"
Converts string value to snake_case'd value.
Converts string value to snake_case'd value.
string value
snake_case'd value
Params for modification.
Params for modification.
Updates the specified single resource.
Updates the specified single resource.
PUT /{resources}/{id}
id
format
result
Use relative path if true.
Use relative path if true. This is set as false by default.
If you set this as true, routing will become simpler but /{resources}.xml or /{resources}.json don't work.
Defines use snake_case'd keys.
Defines use snake_case'd keys.
true if use snake_case keys (default: false)
Creates validator with prefix(resourceName).
Creates validator with prefix(resourceName).
params
validations
current locale
validator
Creates new validation form.
Creates new validation form.
validations
current locale
validator
Creates new validation form.
Creates new validation form.
key prefix for error message
params
validations
current locale
validator
Creates new validation form.
Creates new validation form.
params
key prefix for error message
validations
current locale
validator
Provides code block with format.
Provides code block with format. If absent, halt as status 406.
response type
format
action
result
Each resource item element name in the XML response.
Each resource item element name in the XML response.
Root element name in the XML response.
Root element name in the XML response.
(Since version 2.1.0) Do not invoke directly. Use withRequest
to change the binding, or request to get the value
(Since version 2.1.0) Do not invoke directly. Use withResponse
to change the binding, or response
to get the value
(Since version 2.1.0) Use servletContext instead
(Since version 1.0.0) Use createApiUrl instead
(Since version 1.0.0) Use destroyApiUrl instead
(Since version 1.0.0) Use destroyApiUrl instead
(Since version 1.0.0) Use destroyApiUrl instead
(Since version 1.0.0) Use indexApiUrl instead
(Since version 1.2.0) Use #getFromRequestScope instead. This method will be removed since 1.3.
(Since version 2.3) format
now means the same as responseFormat
, responseFormat
will be removed eventually
(Since version 1.0.0) Use showApiUrl instead
(Since version 2.1.0) Use status_=(Int) instead
(Since version 1.0.0) Use updatePatchApiUrl instead
(Since version 1.0.0) Use updatePostApiUrl instead
(Since version 1.0.0) Use updatePutApiUrl instead
Skinny resource is a DRY module to implement ROA(Resource-oriented architecture) apps. SkinnyApiResource is surely inspired by Rails ActiveSupport.