File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ Post.create({
5151 content: ' Post content'
5252})
5353.then (function (post ) {
54- console .log (post .slug ); // 'This -is-a-new-post'
54+ console .log (post .slug ); // 'this -is-a-new-post'
5555});
5656```
5757
@@ -63,14 +63,14 @@ Post.create({
6363 content: ' A new post again'
6464})
6565.then (function (post ) {
66- console .log (post .slug ); // 'This -is-a-new-posta50ec97e-9ae1-44a5-8fb2-81c665b61538'
66+ console .log (post .slug ); // 'this -is-a-new-posta50ec97e-9ae1-44a5-8fb2-81c665b61538'
6767});
6868```
6969
7070Like any other attribute, you can use dynamic finders:
7171
7272``` js
73- Post .findOneBySlug (' This -is-a-new-post' )
73+ Post .findOneBySlug (' this -is-a-new-post' )
7474.then (function (post ) {
7575 // Use the post
7676})
@@ -79,6 +79,14 @@ Post.findOneBySlug('This-is-a-new-post')
7979});
8080```
8181
82+ ## Configuration
83+
84+ These parameters can be changed in ` sails.config.slugs ` :
85+
86+ Parameter | Type | Details
87+ -------------- | ------------------- |:---------------------------------
88+ lowercase | ` boolean ` | Whether or not the generated slugs are lowercased. Defaults to ` true ` .
89+
8290## License
8391
8492MIT © 2015 Jérémie Ledentu
You can’t perform that action at this time.
0 commit comments