I am a beginner in ruby. I have a table in a view, which when I click on the line / item it should pick up the ID of the selected line and move to the other view that will be triggered, I am 3 days searching about and can not implement.
The view that should pick up the ID or another parameter so that in the other I can handle the select to bring more detailed information >>
<td>
<%= link_to pedido.id, detalhes_backoffice_pedidos_path(:pedido_id => pedido.id) , :onclick=>"window.open(this.href,'create_company', 'height=600, width=600');return false;" %>
</td>
The view ("popup") that is called when clicked on the request id. Note: I have tried in many ways, and at the moment it is like this ... > > > >
<div class='container-fluid'>
<div style='display: block;' class="col-xs-6 esquerdo ">
<label>Num.pedido<%= pedido.id %></label> <br>
<label>nome</label> <br>
<label>telefone</label> <br>
</div>
Controller > >
class Backoffice::PedidosController < BackofficeController
.....
def detalhes
render :layout => "application"
@pedido = params[:pedido_id]
end
I'm totally lost, after trying so hard.