Laravel 4 のネストされたルーティングに問題があります。作成方法のフォームは表示できるのですが、保存できません。これがコードです。要点を説明します。ベース リソース コントローラーと別のネストされたコントローラーがあります。
This is in my Routes.php
Route::resource('profile','ProfileController');
Route::resource('profile.bands','BandsController');
ここにプロファイルのコードを表示する必要はないと思います。BandsController を示します。
public function create($profileId)
{
return View::make('bands.create',['title' => 'Create Band Profile' , 'profileId' => $profileId]);
}
ご存知のように、これはフォームを表示するだけです。フォームは次のとおりです。
{{Form::open( [ 'route' => ['profile.bands.create',$profileId]])}}
<input class="input" type="text" name="name" value="" />
<input class="input" type="text" name="city" value="" />
<input type="submit" value="submit" />
{{Form::close()}}
今、私は理解していませんでした.フォームアクションのURLは、ブラウザで表示するとうまく見えますが、送信すると、このエラーが発生します.
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
open: E:\server\www\gigmor.com\gigmor\vendor\laravel\framework\src\Illuminate\Routing\Router.php
// The method not allowed exception is essentially a HTTP 405 error, so we
// will grab the allowed methods when converting into the HTTP Kernel's
// version of the exact error. This gives us a good RESTful API site.
elseif ($e instanceof MethodNotAllowedException)
{
$allowed = $e->getAllowedMethods();
throw new MethodNotAllowedHttpException($allowed, $e->getMessage());
}
}
私は何を間違えたのでしょうか?