README.md in rosebud-0.1.2 vs README.md in rosebud-0.2.0
- old
+ new
@@ -35,31 +35,31 @@
To validate parameters specify a ```params``` block and choose whether the params are required or optional.
```ruby
class Api::V1::SomeController < Api::V1::ApplicationController
include Rosebud
-
+
params do
requires :name
optional :phone_number, regex: /\d{10}/, default: '5555555555'
end
-
+
...
-
+
end
```
It's also possible to define validations for a specific action.
```ruby
class Api::V1::SomeController < Api::V1::ApplicationController
include Rosebud
-
+
params :create do
...
end
-
+
def create
...
end
end
```
@@ -106,15 +106,15 @@
Add a validation using your custom validator:
```ruby
class Api::V1::SomeController < Api::V1::ApplicationController
include Rosebud
-
+
params :create do
requires :name, length: 2
end
-
+
def create
...
end
end
```
@@ -123,11 +123,11 @@
```json
{
"error": "length",
"description": "3 characters is too long for name, should be less than or equal to 2",
- "additional_info": "Kcik him in the shins!"
+ "additional_info": "Kick him in the shins!"
}
```
## Contributing
@@ -140,6 +140,6 @@
## Credits
[](http://www.sticksnleaves.com)
Rosebud is maintained and funded by [Sticksnleaves](http://www.sticksnleaves.com)
-Thanks to all of our [contributors](https://github.com/anthonator/rosebud/graphs/contributors)
\ No newline at end of file
+Thanks to all of our [contributors](https://github.com/anthonator/rosebud/graphs/contributors)