First at all sorry if my english is not the best. In the view I have this code: <%= select_tag "tabla", options_for_select(["Famitel", "Polycom Kirk", "LG Nortel", "Dimax Videovigilancia"]) %> <%= text_field :buscar, params[:codigo_aleatorio]%> <%= button_to "Buscar" , :action => :elijovista %> In elijovista´s controller I need to know the item that was selected in tabla and the text. my code is: def elijovista debugger return params[:payment] case :tabla when "Famitel" @ticket=Ticket.find( :first, :select =>"reference", :conditions=>[''codigo_aleatorio=?'',params[:codigo_aleatorio]]) # renders app/views/zonaclientes/showFamitel render :template => ''zonaclientes/showFamitel'' return . . . . (The same for the rest of the items) . . But render never works, always show the elijovista view. Whats wrong? How can obtain the option selected in tabla? Thanks for all --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12 Dec 2008, at 14:49, joripel wrote:> > > > First at all sorry if my english is not the best. > > In the view I have this code: > > <%= select_tag "tabla", options_for_select(["Famitel", "Polycom Kirk", > "LG Nortel", "Dimax Videovigilancia"]) %> > <%= text_field :buscar, params[:codigo_aleatorio]%> > <%= button_to "Buscar" , :action => :elijovista %> > > In elijovista´s controller I need to know the item that was selected > in > tabla and the text. > > my code is: > def elijovista > debugger > return params[:payment] >return halts processing of the action Fred> > case :tabla > when "Famitel" > @ticket=Ticket.find( :first, :select =>"reference", > :conditions=>[''codigo_aleatorio=?'',params[:codigo_aleatorio]]) > > # renders app/views/zonaclientes/showFamitel > render :template => ''zonaclientes/showFamitel'' > return > . > . > . > . > (The same for the rest of the items) > . > . > But render never works, always show the elijovista view. > > Whats wrong? How can obtain the option selected in tabla? > > Thanks for all > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry, I did several tests.This two lines don''t exists debugger return params[:payment] --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The problem is that in the view when i push the button it works like a link_to and tabla y codigo_aleatorio aren''t present in elijovista :( Any help? I don''t know how solve this --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 12, 2:49 pm, joripel <jori...-uAjRD0nVeow@public.gmane.org> wrote:> case :tabla > when "Famitel"These lines here are also weird. The lines below would only run if :table were to be === to "Famitel", which would never happen. (did you mean params[:tabla] ? Fred> @ticket=Ticket.find( :first, :select =>"reference", > :conditions=>[''codigo_aleatorio=?'',params[:codigo_aleatorio]]) > > # renders app/views/zonaclientes/showFamitel > render :template => ''zonaclientes/showFamitel'' > return > . > . > . > . > (The same for the rest of the items) > . > . > But render never works, always show the elijovista view. > > Whats wrong? How can obtain the option selected in tabla? > > Thanks for all--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
With case params[:tabla] the variables are the same. I can''t use params[:tabla] in elijovista controller :( --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---