<commit_before>var app = app || {};

app.GameCreate = Backbone.View.extend({
	tagName: 'div',

	template: _.template($('#game-create-template').html()),

	events: {
        'submit': 'createGame'
	},

	initialize: function(){
        // Re-render table when collection changes
        //this.listenTo(this.model, 'change', this.render);
        this.$body = $("#body");
        this.$body.html(this.el);
        this.render();
	},

	render: function(){
        this.$el.html( this.template({ data: { users: this.collection } }) );
        
		return this;
	},

    createGame: function(){
        // Collect values from view
        var values = {
            name: this.$el.find('.name').val(),
            first_name: this.$el.find('.first-name').val(),
            last_name: this.$el.find('.last-name').val(),
            email: this.$el.find('.email').val(),
            birthday: this.$el.find('.birthday').val()
        };

        // Update model with new values
        this.model.set(values);

        // Add model to collection
        app.users.add(this.model);

        // Forward on to list of users
        app.FoosballRouter.navigate('users', { trigger: true });

        return false;
    }
});<commit_msg>Added more to the Create Game View.<commit_after>var app = app || {};

app.GameCreate = Backbone.View.extend({
	tagName: 'div',

	template: _.template($('#game-create-template').html()),

	events: {
        'submit': 'createGame'
	},

	initialize: function(){
        // Create game model we'll be creating 

        // Attach to the game model's request and sync event

        // Render the view
        this.$body = $("#body");
        this.$body.html(this.el);
        this.render();
	},

	render: function(){
        this.$el.html( this.template({ data: { users: this.collection } }) );
        
		return this;
	},

    parseValues: function(){

    },

    createGame: function(){
        // Create new game model with values from view

        // Save game

        // Forward on to list of users
        app.FoosballRouter.navigate('users', { trigger: true });

        return false;
    }
});
{'fraction_non_alphanumeric': 0.16627414036740462, 'fraction_numerical': 0.0, 'mean_word_length': 2.137370753323486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '733070', 'n_tokens_mistral': 633, 'n_tokens_neox': 605, 'n_words': 151}