Skip to content

Commit

Permalink
Merge pull request #190 from JulieMarie/nearby-fix
Browse files Browse the repository at this point in the history
ratings fix
  • Loading branch information
JulieMarie committed Jan 22, 2015
2 parents 383f163 + c19b104 commit 0e6aca6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions public/dist/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,19 @@ angular.module('nearby').controller('BreweryController', ['$scope', 'Brewery', '
];

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

index = Core.findIndexByKeyValue($scope.beers, 'id', beerId);
console.log('index: ', index);
console.log('beerId: ', beerId);
console.log('index before: ', index);
// 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,
name: $scope.beers[index].name,
stars: this.rate,
styleName: $scope.beers[index].style.name
});
console.log('rating.beerId: ', rating.beerId);

// Redirect after save
rating.$save(function(response) {
Expand Down
Loading

0 comments on commit 0e6aca6

Please sign in to comment.