Permalink
Browse files

Lint corrections

  • Loading branch information...
1 parent c9b18bc commit 2cd30fe1beb91ae1daf16d48b8a43e6cc1b94f81 @hkjels committed Jun 5, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/crud.js
View
@@ -48,9 +48,9 @@ Resource.prototype.index = function (req, res) {
* Displays a form for creating new instances
*/
-Resource.prototype.new = function (req, res) {
+Resource.prototype['new'] = function (req, res) {
var form = friendly(this.Model)
- form.name = Model.modelName.toLowerCase()
+ form.name = this.Model.modelName.toLowerCase()
res.render('form', {'form': form})
}
@@ -95,7 +95,7 @@ Resource.prototype.edit = function (req, res) {
var instance = en.singularize(this.Model.modelName).toLowerCase()
, model = req[instance]
, form = friendly(model)
- form.name = Model.modelName.toLowerCase()
+ form.name = this.Model.modelName.toLowerCase()
res.render('form', {'form': form})
}
@@ -155,7 +155,8 @@ Resource.prototype.load = function (req, id, cb) {
app.crud = function (name, actions, opts) {
var options = actions || {}
- , res
+ , res
+ , Model
for (var model in mongoose.models) {
if (!mongoose.models.hasOwnProperty(model)) continue

0 comments on commit 2cd30fe

Please sign in to comment.