README.md in weak_parameters-0.4.2 vs README.md in weak_parameters-0.4.3
- old
+ new
@@ -24,10 +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"
end
def create
# pass the only parameters with strong option. like strong parameters.
respond_with Recipe.create(permitted_params)
@@ -57,9 +59,11 @@
* string
* boolean (= 0, 1, false, true)
* file
* object
* list
+* date (= default %Y-%m-%d)
+* time (= default %Y-%m-%d %H:%M:%S)
### Available options
* required
* only
* except