Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing merge conflict with updated selectors from pull request #132

  • Loading branch information...
commit 57c1fbc73431659b2500feccd1528c66d3578a02 2 parents 084bb87 + decfe3a
@ryanfitz ryanfitz authored
View
2  lib/generators/backbone/scaffold/templates/templates/edit.jst
@@ -14,4 +14,4 @@
</form>
-<a href="#/index">Back</a>
+<a href="#/index">Back</a>
View
10 lib/generators/backbone/scaffold/templates/views/edit_view.coffee
@@ -1,17 +1,17 @@
<%= view_namespace %> ||= {}
class <%= view_namespace %>.EditView extends Backbone.View
- template : JST["<%= jst 'edit' %>"]
+ template: JST["<%= jst 'edit' %>"]
- events :
- "submit #edit-<%= singular_name %>" : "update"
+ events:
+ "submit #edit-<%= singular_name %>": "update"
- update : (e) ->
+ update: (e) ->
e.preventDefault()
e.stopPropagation()
@model.save(null,
- success : (<%= singular_name %>) =>
+ success: (<%= singular_name %>) =>
@model = <%= singular_name %>
window.location.hash = "/#{@model.id}"
)
View
15 test/generators/scaffold_generator_test.rb
@@ -62,8 +62,8 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_file "#{backbone_path}/views/posts/edit_view.js.coffee" do |view|
assert_match /class Dummy.Views.Posts.EditView extends Backbone.View/, view
assert_match /#{Regexp.escape('JST["backbone/templates/posts/edit"]')}/, view
- assert_match /#{Regexp.escape('"submit #edit-post" : "update"')}/, view
- assert_match /#{Regexp.escape('success : (post) =>')}/, view
+ assert_match /#{Regexp.escape('"submit #edit-post": "update"')}/, view
+ assert_match /#{Regexp.escape('success: (post) =>')}/, view
end
assert_file "#{backbone_path}/views/posts/post_view.js.coffee" do |view|
@@ -99,9 +99,12 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_file "#{backbone_path}/views/blog_posts/edit_view.js.coffee" do |view|
assert_match /class Dummy.Views.BlogPosts.EditView extends Backbone.View/, view
- assert_match /#{Regexp.escape('JST["backbone/templates/blog_posts/edit"]')}/, view
- assert_match /#{Regexp.escape('"submit #edit-blog_post" : "update"')}/, view
- assert_match /#{Regexp.escape('success : (blog_post) =>')}/, view
+ assert_match /#{Regexp.escape('template: JST["backbone/templates/blog_posts/edit"]')}/, view
+ assert_match /#{Regexp.escape('"submit #edit-blog_post": "update"')}/, view
+ assert_match /#{Regexp.escape('success: (blog_post) =>')}/, view
+ assert_match /#{Regexp.escape('events:')}/, view
+ assert_match /#{Regexp.escape('update: (e) ->')}/, view
+ assert_match /#{Regexp.escape('render: ->')}/, view
end
assert_file "#{backbone_path}/views/blog_posts/blog_post_view.js.coffee" do |view|
@@ -173,4 +176,4 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.