This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.Models.TodoItem extends Backbone.Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.Collections.TodoItems extends Backbone.Collection | |
model: App.Models.TodoItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
App.Data.todos = new App.Collections.TodoItems [{title: 'Make Marionette Presentation'}, {title: 'Present Marionette Presentation'}] | |
App.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.Views.BTodos extends Backbone.View | |
render: -> | |
html = '<ul></ul>' | |
@$el.html(html) | |
for todo in @collection.models | |
bTodoView = new App.Views.BTodo(model: todo) | |
@$el.append(bTodoView.render().el) | |
@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.Views.BTodo extends Backbone.View | |
tagName: 'li' | |
render: -> | |
@$el.html(@model.get('title')) | |
@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
App.Data.todos = new App.Collections.TodoItems [{title: 'Make Marionette Presentation'}, {title: 'Present Marionette Presentation'}] | |
bTodosView = new App.Views.BTodos(collection: App.Data.todos) | |
$('.bb-todos-view').html(bTodosView.render().el) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.Views.MTodos extends Backbone.Marionette.CollectionView | |
tagName: 'ul' | |
itemView: App.Views.MTodo | |
template: -> | |
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.Views.MTodo extends Backbone.Marionette.ItemView | |
tagName: 'li' | |
template: (options) -> | |
return options.title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
App.Data.todos = new App.Collections.TodoItems [{title: 'Make Marionette Presentation'}, {title: 'Present Marionette Presentation'}] | |
App.addRegions | |
mTodosView: "#m-todos-view" | |
mTodosView = new App.Views.MTodos(collection: App.Data.todos) | |
App.mTodosView.show mTodosView |
OlderNewer