Click here to Skip to main content
14,271,130 members

Web Development

 
AnswerRe: Copy and Paste to aspx GridView Pin
Richard Deeming20-Mar-19 13:02
mveRichard Deeming20-Mar-19 13:02 
GeneralRe: Copy and Paste to aspx GridView Pin
Wayne Hollier22-Mar-19 1:12
memberWayne Hollier22-Mar-19 1:12 
QuestionNo action was found on the controller Pin
Kevin Marois18-Mar-19 15:16
professionalKevin Marois18-Mar-19 15:16 
AnswerRe: No action was found on the controller Pin
Richard Deeming19-Mar-19 2:16
mveRichard Deeming19-Mar-19 2:16 
QuestionTemplate engine (Ejs) Pin
Member 1418486016-Mar-19 20:43
memberMember 1418486016-Mar-19 20:43 
QuestionHosting WebAPI OnServer Pin
Kevin Marois12-Mar-19 14:09
professionalKevin Marois12-Mar-19 14:09 
AnswerRe: Hosting WebAPI OnServer Pin
Nathan Minier18-Mar-19 1:55
professionalNathan Minier18-Mar-19 1:55 
QuestionWhy my update & insert form return url+token instead of insert/update data (laravel) Pin
Galih indra waspada11-Mar-19 23:29
memberGalih indra waspada11-Mar-19 23:29 
I'm working on simple crud in laravel.I already built Controller,form, and model.But everytime i click the submit input.They always return this url and show 404 not found error,instead of insert the data.Can someone help me to find the problem?i have no clue about this part.

http://127.0.0.1:8000/POST?_token=bD5c3O0XpfTX7NWL7RA7wXSw3rWrQ12fbGLMw0kf&kode=galih&nama=galih&submit=Submit[^]

I set the route using Route::resource('urusan','MasterUrusanController)
Insert Form
<form action="POST" action="{{url('urusan')}}">
{{ csrf_field() }}
<table>
    <thead>
        <tr>
            <td>Kode Urusan</td>
            <td><input type="text" name="kode"></td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Nama Urusan</td>
            <td><input type="text" name="nama"></td>
        </tr>
        <tr>
            <td colspan="2" align="center"><input type="submit" name="submit" class="btn btn-primary" value="Submit"></td>
        </tr>
    </tbody>
</table>
</form>


Insert Form
<form action="POST" action="{{route('urusan.update',$urusan->kode_urusan)}}">
             {{ method_field("PUT") }}
       {{ csrf_field() }}
           <thead>
               <tr>
                   <td>Kode Urusan</td>
               <td><input type="text" name="kode" value="{{$urusan->kode_urusan}}"></td>
               </tr>
           </thead>
           <tbody>
               <tr>
                   <td>Nama Urusan</td>
                   <td><input type="text" name="nama" value="{{$urusan->nama_urusan}}"></td>
               </tr>
               <tr>
                   <td colspan="2" align="center"><input type="submit" name="submit" class="btn btn-primary" value="Update"></td>
               </tr>
           </tbody>

           </form>

       </table>



Controller

class MasterUrusanController extends Controller
{
    public function index()
    {
        $urusan=MasterUrusan::all();
        return view('master_urusan.select',['urusan'=>$urusan]);
        //return View::make('master_urusan.select')->with('urusan',$urusan);
    }

    public function create()
    {
        return view('master_urusan.insert') ;
    }

    public function store(Request $request)
    {
        $data=new MasterUrusan();
        $data->nama = $request->get('kode');
        $data->nama = $request->get('nama');
        $data->save();
        return redirect('/urusan');
    }

    public function edit($kode_urusan)
    {

        
        $data = MasterUrusan::where('kode_urusan','=',$kode_urusan)->firstOrFail();
        return view('master_urusan.update', ['urusan' => $data]);
    }
    public function update(Request $request,$kode_urusan)
    { 
        $data = MasterUrusan::where('kode_urusan','=',$kode_urusan)->firstOrFail();
        $data->nama = $request->get('nama');
        $data->save();
        return redirect('/urusan');
        
    }

    public function destroy($kode_urusan)
    {
        $data = MasterUrusan::where('kode_urusan','=',$kode_urusan)->firstOrFail();
        $data->delete();
        return redirect('/urusan');
    }
}


modified 12-Mar-19 5:47am.

AnswerRe: Why my update & insert form return url+token instead of insert/update data (laravel) Pin
Richard Deeming12-Mar-19 2:52
mveRichard Deeming12-Mar-19 2:52 
QuestionProblem on Opening Password-Protected ZIP File that created on Heroku Server ( Python App ) Pin
HardCoder66611-Mar-19 18:10
memberHardCoder66611-Mar-19 18:10 
QuestionModal popup from web page during long processing task Pin
Member 1413757611-Mar-19 15:23
memberMember 1413757611-Mar-19 15:23 
AnswerRe: Modal popup from web page during long processing task Pin
Richard Deeming12-Mar-19 2:48
mveRichard Deeming12-Mar-19 2:48 
Questiondiv width not working Pin
V.11-Mar-19 2:53
professionalV.11-Mar-19 2:53 
AnswerRe: div width not working Pin
Richard Deeming11-Mar-19 8:53
mveRichard Deeming11-Mar-19 8:53 
GeneralRe: div width not working Pin
V.11-Mar-19 21:27
professionalV.11-Mar-19 21:27 
QuestionIs there an easy way into Razor, without necessarily adopting all of MVC to begin with? Pin
Patrick Skelton7-Mar-19 1:02
memberPatrick Skelton7-Mar-19 1:02 
AnswerRe: Is there an easy way into Razor, without necessarily adopting all of MVC to begin with? Pin
Richard Deeming7-Mar-19 1:05
mveRichard Deeming7-Mar-19 1:05 
GeneralRe: Is there an easy way into Razor, without necessarily adopting all of MVC to begin with? Pin
Patrick Skelton11-Mar-19 1:17
memberPatrick Skelton11-Mar-19 1:17 
GeneralRe: Is there an easy way into Razor, without necessarily adopting all of MVC to begin with? Pin
MadMyche11-Mar-19 17:22
mveMadMyche11-Mar-19 17:22 
GeneralRe: Is there an easy way into Razor, without necessarily adopting all of MVC to begin with? Pin
Patrick Skelton12-Mar-19 2:25
memberPatrick Skelton12-Mar-19 2:25 
QuestionOpenID, ADSF, custom LoginID Pin Pin
Super Lloyd4-Mar-19 5:09
memberSuper Lloyd4-Mar-19 5:09 
QuestionMenu's in HTML Pin
BobInNJ2-Mar-19 19:32
memberBobInNJ2-Mar-19 19:32 
AnswerRe: Menu's in HTML Pin
David Mujica4-Mar-19 10:48
memberDavid Mujica4-Mar-19 10:48 
AnswerRe: Menu's in HTML Pin
V.11-Mar-19 3:09
professionalV.11-Mar-19 3:09 
AnswerRe: Menu's in HTML Pin
Bohdan Stupak15-Mar-19 5:45
professionalBohdan Stupak15-Mar-19 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.