Skip to content

Commit

Permalink
Merge pull request #189 from JulieMarie/nearby-fix
Browse files Browse the repository at this point in the history
ratings submit
  • Loading branch information
JulieMarie committed Jan 22, 2015
2 parents df567e5 + 8abfe70 commit 383f163
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ angular.module('nearby').controller('BreweryController', ['$scope', 'Brewery', '
];

// Create new Rating
$scope.create = function(index, beerId, beerId2) {
$scope.create = function(index) {

console.log('index before: ', index);
console.log('beerId2: ', beerId2);
index = Core.findIndexByKeyValue($scope.beers, 'id', beerId);
console.log('index after: ', index);
console.log('beerId: ', beerId);
// index = Core.findIndexByKeyValue($scope.beers, 'id', beerId);
// console.log('index after: ', index);
// console.log('beerId: ', beerId);
// Create new Rating object
var rating = new Ratings ({
beerId: $scope.beers[index].id,
Expand Down
2 changes: 1 addition & 1 deletion public/modules/brewery/views/brewery.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h4>Locations:</h4>
<a href="#!/beer/{{beer.id}}"><h4 class="beer-name">{{beer.name}}</h4></a>
<span ng-if="beer.availableId">Available: {{beer.available.name}}</span>

<form class="form-horizontal text-left ratings" data-ng-submit="create($index, beer.id, {{beer.id}})" novalidate>
<form class="form-horizontal text-left ratings" data-ng-submit="create($index)" novalidate>
<fieldset>
<div class="form-group">
<label class="control-label" for="rating">Please rate this beer:</label>
Expand Down

0 comments on commit 383f163

Please sign in to comment.