Add manufacturer to edit form

This commit is contained in:
Nick Peelman
2013-11-27 10:06:36 -05:00
parent 0aa3c676c2
commit b5a0da03a8
2 changed files with 9 additions and 0 deletions
@@ -38,6 +38,7 @@ class ModelsController extends AdminController {
{
// Show the page
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'N/A') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->lists('name', 'id');
return View::make('backend/models/edit')->with('category_list',$category_list)->with('depreciation_list',$depreciation_list)->with('model',new Model);
}
+8
View File
@@ -50,6 +50,14 @@
</div>
</div>
<!-- Manufacturer -->
<div class="control-group {{ $errors->has('manufacturer_id') ? 'error' : '' }}">
<label class="control-label" for="parent">Manufacturer</label>
<div class="controls">
{{ Form::select('manufacturer_id', $manufacturer_list , Input::old('manufacturer_id', $model->manufacturer_id), array('class'=>'select2', 'style'=>'width:250px')) }}
{{ $errors->first('manufacturer_id', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Depreciation -->
<div class="control-group {{ $errors->has('depreciation_id') ? 'error' : '' }}">