README.md in weak_parameters-0.4.3 vs README.md in weak_parameters-0.5.0
- old
+ new
@@ -24,12 +24,12 @@
string :name, required: true, except: ["charlie", "dave"], strong: true
integer :type, only: 1..3, strong: true
string :quantity do |value|
value =~ /\A\d+(?:\.\d+)g\z/
end
- date :date, only: ["%Y/%m/%d", "%Y.%m.%d"]
- time :time, only: "%Y/%m/%d %H:%M:%S"
+ date :date, format: ["%Y/%m/%d", "%Y.%m.%d"]
+ time :time, format: "%Y/%m/%d %H:%M:%S"
end
def create
# pass the only parameters with strong option. like strong parameters.
respond_with Recipe.create(permitted_params)
@@ -68,9 +68,10 @@
* required
* only
* except
* handler
* strong
+* format (only for date and time)
## Tips
WeakParameters.stats returns its validation metadata, and this is useful for auto-generating API documents.
With [autodoc](https://github.com/r7kamura/autodoc), you can auto-generate API documents with params information.