pepe wrote:
> Perd�n, deber�a haber dicho 'cada "array" interno deber�a contener...'
> 
> Pepe
buen dia men gracias por tu interes se ve que tienes el conocimiento te 
voy a colocar el codigo para que  me puedas facilitar mejor tu 
conocimiento.class Repuesto::RetmoveController < ApplicationController
  layout 'repuesto'
  include Inserciones

 def index
 constantes()
 @a...@prbxx
 session[:cond] =" "
    @limit =5
    @conditions = " "
    @page = params[:page].blank? ? 0 : params[:page].to_i
    #...@cant = Re_tmtinv.find(:all, :conditions => @conditions).size
    @from = @page == 0 ? 0 : @pa...@limit

   ## para hacer una consulta a una tabla en la BD Oracle
 autosys_db = DBI.connect('dbi:ODBC:autosys','repuesto','repuesto')
 sql = autosys_db.prepare("SELECT mtin_mtin,mtin_descri FROM re_tmtinv")
    sql.execute
    ar_tmp = sql.fetch
    autosys_db.disconnect

    @all_retmove=ar_tmp
 end
  def paginar
      @limit = 5
    if !params[:retmove].blank?
    condiciones()
              session[:con...@conditions
    else
    @conditions = session[:cond]
    end
      @page = params[:page].blank? ? 0 : params[:page].to_i
      #...@cant = Retmtinv.find(:all, :conditions => @conditions).size
      @from = @page == 0 ? 0 : @pa...@limit
    #...@all_retmove = Retmtinv.find(:all, :conditions => @conditions, 
:limit => "#...@from},#...@limit}", :order => "id DESC")
    autosys_db = DBI.connect('dbi:ODBC:autosys','repuesto','repuesto')
    sql = autosys_db.prepare("SELECT mtin_mtin,mtin_descri FROM 
re_tmtinv where mtin_mtin = #'{mtin}and mtin_descri = #'{descri} '")
    sql.execute
    ar_tmp = sql.fetch
    autosys_db.disconnect

    @all_retmove=ar_tmp
      render(:partial => 'listretmove')
  end
end

la vista es la siguiente
<fieldset>

  <legend><big>Repuestos Registrados</big></legend>

<% form_for :model, @model, :url => { :action => 'action' } do |c| %>

<div id="listaSpace">
  <table align="center" width="70%">
    <tr>
      <td class="form_header" align="center" width="80%">Repuestos </td>
      <td class="form_header" colspan="3" align="center" width="5%"> 
Opciones </td>
    </tr>
  <% @cont = 0 %>
  <% @all_retmove.each do |c| %>
  <% @cont += 1 %>
  <% @cont % 2 == 0 ? @cl = "par" : @cl = "impar" %>
 <tr class="<%= @cl %>">
    <td class="form">
     <%= c[1] %>
      </td>


      <td align="center" width="1%">
    <%= 
link_to(image_tag("botones/modificar.gif",:border=>0,:size=>'20x20', 
:title => "Modificar", :alt=>'Modificar Seleccionados'),:controller => 
'/repuesto/retmove', :action => :modretmove, :mtin_mtin => c[0] ) %>
      </td>
      <td align="center" width="1%">
        <%= 
link_to_remote(image_tag("botones/borrar2.gif",:border=>0,:size=>'20x20', 
:title => "Eliminar", :alt=>'Eliminar Seleccionados'),:url => 
{:controller => '/repuesto/retmove', :action => :Delete, :mtin_mtin => 
c[0] }, :update => 'renderSpace2', :confirm=>'Esta seguro de querer 
eliminar este registro?') %>
      </td>

    </tr>
  <% end %>
  </table>
</div>

<p align="center">
  <% if @page > 0 %>
    <%= link_to_remote(image_tag("botones/anterior2.gif", 
:Size=>'30x30', :border=>0, :title=>'Anterior'), :update => 
'renderSpace2', :url => {:controller => '/repuesto/retmove', :action => 
:Paginar}, :with => "'page='+ #...@page-1}")%>
  <% end %>
  <%= link_to_remote(image_tag("botones/siguiente2.gif", :Size=>'30x30', 
:border=>0, :title=>'Siguiente'), :update => 'renderSpace2', :url => 
{:controller => '/repuesto/retmove', :action => :Paginar}, :with => 
"'page='+ #...@page+1}")%>
 <% end %>
###############################################################################
ok como bien podras visualizar tengo el siguiente problema no me esta 
generando la informacion que yo requiero solo me muestra un 80 y 88 
cuando yo en realidad necesito que me muestre el codigo y la descripcion 
del repuesto,que sugieres en este caso.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to