Skip to content

Commit

Permalink
Merge pull request BootstrapCMS#185 from xcaptain/hotfix/editformpatch
Browse files Browse the repository at this point in the history
bugfix: fix edit page form and edit post form
  • Loading branch information
GrahamCampbell committed Sep 5, 2015
2 parents eb4d63c + fd6aee3 commit 801ee80
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion resources/views/pages/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<div class="well">
<?php
$form = ['url' => URL::route('pages.update', ['pages' => $page->slug]),
'method' => 'PATCH',
'_method' => 'PATCH',
'method' => 'POST',
'button' => 'Save Page',
'defaults' => [
'title' => $page->title,
Expand Down
1 change: 1 addition & 0 deletions resources/views/pages/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<form class="form-horizontal" action="{{ $form['url'] }}" method="{{ $form['method'] }}">

{{ csrf_field() }}
<input type="hidden" name="_method" value="{{ $form['_method'] }}">

<div class="form-group{!! ($errors->has('title')) ? ' has-error' : '' !!}">
<label class="col-md-2 col-sm-3 col-xs-10 control-label" for="title">Page Title</label>
Expand Down
3 changes: 2 additions & 1 deletion resources/views/posts/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<div class="well">
<?php
$form = ['url' => URL::route('blog.posts.update', ['posts' => $post->id]),
'method' => 'PATCH',
'_method' => 'PATCH',
'method' => 'POST',
'button' => 'Save Post',
'defaults' => [
'title' => $post->title,
Expand Down
1 change: 1 addition & 0 deletions resources/views/posts/form.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<form class="form-horizontal" action="{{ $form['url'] }}" method="{{ $form['method'] }}">

{{ csrf_field() }}
<input type="hidden" name="_method" value="{{ $form['_method'] }}">

<div class="form-group{!! ($errors->has('title')) ? ' has-error' : '' !!}">
<label class="col-md-2 col-sm-3 col-xs-10 control-label" for="title">Post Title</label>
Expand Down

0 comments on commit 801ee80

Please sign in to comment.