Skip to content

Commit 6ac784d

Browse files
committed
Make sure new/edit exists before calling them on create/update.
1 parent ea1aa76 commit 6ac784d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/generators/rails_script/install/templates/base.js.coffee

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ class App.Base
66

77

88
create: ->
9-
$this.new()
10-
return
9+
if typeof $this.new == 'function'
10+
return $this.new()
1111

1212

1313
update: ->
14-
$this.edit()
15-
return
14+
if typeof $this.edit == 'function'
15+
return $this.edit()

0 commit comments

Comments
 (0)