Estimados,

Los
molesto porque tengo un formulario con una sección con un option value
obtenido de una tabla y si bien me funciona bien la vista, estoy
teniendo problemas para salvar el estado seleccionado en la tabla.


Les paso el codigo de la vista:

<select name="report[<%= report.id %>][priority_id]">
        <% Priority.find(:all).each do |priority| %>              
       
<option value="<%= priority.id %>" <%=
@complaint.max_priority == priority.id %>> <%=
priority.name.capitalize %>
      </option>
        <% end %>
      </select>

Les paso la
 función de ruby:

  def save
    #logger.debug("EEEEEEEEEEEEEEEEEE"+params[:report][7])
    params[:report].each do |report_id, report_params|
      report = Report.find(report_id)
      #logger.debug("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+report_id + 
report_params.to_yaml)
      if !report_params[:comment].blank? then
        comment = report.comments.build()
        comment.comment = report_params[:comment]
        comment.user_id = current_user.id
        comment.save!
      end
      if !report_params[:tipification_ids].empty? then
        report.tipification_ids =
 report_params[:tipification_ids]
        report.analizar!
        report.save!
      end
      redirect_to :action => 'listing'
    end
  end


Agradezco mucho su colaboración.

Saludos.

Diego.

 




      



      
_______________________________________________
Ruby mailing list
[email protected]
http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar

Responder a