Fixed piggy bank delete routine.

This commit is contained in:
James Cole 2015-03-01 19:26:30 +01:00
parent bb36ad64a7
commit e26d2376fc
2 changed files with 6 additions and 6 deletions

View File

@ -78,7 +78,7 @@ class PiggyBankController extends Controller
{
$subTitle = 'Delete "' . e($piggyBank->name) . '"';
return view('piggy_banks.delete', compact('piggyBank', 'subTitle'));
return view('piggy-banks.delete', compact('piggyBank', 'subTitle'));
}
/**
@ -90,9 +90,9 @@ class PiggyBankController extends Controller
{
Session::flash('success', 'Piggy bank "' . e($piggyBank->name) . '" deleted.');
$this->_repository->destroy($piggyBank);
$piggyBank->delete();
return Redirect::route('piggy_banks.index');
return Redirect::route('piggy-banks.index');
}
/**

View File

@ -1,7 +1,7 @@
@extends('layouts.default')
@section('content')
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $piggyBank) }}
{{Form::open(['class' => 'form-horizontal','id' => 'destroy','url' => route('piggy-banks.destroy',$piggyBank->id)])}}
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $piggyBank) !!}
{!! Form::open(['class' => 'form-horizontal','id' => 'destroy','url' => route('piggy-banks.destroy',$piggyBank->id)]) !!}
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="panel panel-red">
@ -33,5 +33,5 @@
</div>
{{Form::close()}}
{!! Form::close() !!}
@stop