Because I can not see a part of the web page after a domain redirection

1

I work with a school platform with laravel. But there is a part of the page where I should be able to assign teachers to groups and I no longer appear. I already checked the code and it seems fine. The error started from when I redirected the root folder to a subfolder as the main page.

 {!! Form::open(['url'=> '/admin/usuariosasignar','method'=>'POST',
                                                'files' => true,'role'=>'form','class'=>'']) !!}
                                  <div>
                                    <label for="materia">Asignar Usuario a Grupo</label>
                                  </div>
                                    <div class="input-group input-group-sm">
                                      <input type="hidden" name="caso" value="asignar">
                                      <input type="hidden" name="idg" value="{{$g->id}}">
<select class="form-control" name="materia" id="materia">
                                     @foreach($usuarios as $usu)
<?php $bol=false;?>
@foreach($inscritos as $inscri)
                                        @if($inscri->id_usuario==$usu->id AND $usu->nivel=='alumno')
                                          <?php $bol=true;?>
                                        @endif
                                      @endforeach
@if($bol==false)
                                         <option value="{{$usu->id}}">{{$usu->nombre}} {{$usu->apellidos}}</option>
                                      @endif
@endforeach
</select>
<span class="input-group-btn">
                                        <button class="btn btn-bordered btn-flat" type="submit" id="gen1">Asignar</button>
                                      </span>
                                    </div><!-- /input-group -->
{!! Form::close() !!}

This code is previously to give a little more context.

   @else
             @foreach($inscritos as $usuario1)
             @if(Auth::user()->id==$usuario1->id_usuario AND $usuario1->id_grupo==$g->id)
    <div class="box box-default collapsed-box">
    <div class="box-header with-border">
    <h3 class="box-title" data-widget="collapse">{{$g->grupo}}</h3><div class="box-tools pull-right">
    <button class="btn btn-box-tool" data-widget="collapse">
    <i class="fa fa-plus"></i></button>
                  </div><!-- /.box-tools -->
                </div><!-- /.box-header -->
                <div class="box-body">
                   <table class="table">
                            <tr>
                              <th style="width: 10px">#</th>
                              <th>Usuario</th>
                              <th style="width: 40px"></th>
                            </tr>
                              @foreach($inscritos as $usuario)
                                @if($usuario->id_grupo==$g->id)
                                <tr>
                                  <td>{{$x}}.</td>
                                  <td>{{$usuario->nombre}} {{$usuario->apellidos}}</td>
                                  <td>
                                  <span class="badge bg-navy">
                                      <button style="color:white;background:transparent;border:none"
                                          data-toggle="modal"
                                          data-idgrupo="{{$g->id}}"
                                          data-target="#editarmodal"
                                          class="editar"
                                          data-id="{{$usuario->id}}"
                                          data-idusuario="{{$usuario->id_usuario}}"
                                          data-nombre="{{$usuario->nombre}}"
                                          data-apellidos="{{$usuario->apellidos}}"
                                          data-telefono="{{$usuario->telefono}}"
                                           data-email="{{$usuario->email}}"
                                          >Editar</a>
                                  </span>
                                  </td>
                                </tr>
                                <?php $x++;?>
                                @endif
                            @endforeach
                    </table>

You can guide me to know where the error might be. Thanks

    
asked by Rodrigo 02.10.2017 в 19:05
source

1 answer

0

When you make route changes you have to make sure that the resources are available in the new folder, or indicate that the resources are in the previous folder.

Example;

Folder / home / hamza / pagina-manolito > It contains the following files: index.html , foto_manolo.png

File index.html

<h1>Hola, jejoju </h1>
<h2>Buena fuente, mala gente</h2>
<img src="foto_manolo.png"/>

Now we migrate our page to / home / hamza / pagina-manolito / manolito_nuevo > It contains the following files: index.html

File index.html

<h1>Hola, jejoju </h1>
<h2>Buena fuente, mala gente</h2>
<img src="../foto_manolo.png"/><!-- LE INDICAMOS QUE LA FOTO ESTA EN LA CARPETA ANTERIOR CON '../', SI NO EL PROGRAMA INTENTA CARGAR LA FOTO EN LA RUTA ACTUAL, PERO NO EXISTE

If we do not specify the route of the image, the search in the current route (where it does not exist), since it does not exist, it can not show the image.

In your case you may be looking for /admin/usuariosasignar when it is ../admin/usuariosasignar , these problems are avoided using the absolute path (although you lose the advantages offered by not using the absolute path).

    
answered by 02.10.2017 в 19:28