Hi, I need to make a form with two buttons. But I do wrong. And why not can be. form: ------------------------------- <%= form_tag :controller => ''establishment_contents'', :action => ''llamada'', :opMenu => opcionMenu %> [...] <%= image_submit_tag ("../images/incluir.gif", :op=>"addImage") %> [...] <%= image_submit_tag ("../images/eliminar.gif", :op=>"delImage") %> <%= end_form_tag %> establishment_contents_controller.rb: -------------------------------------- def llamada if (params[:op].nil?) then if (params[:op] == "delImage") then destroy #Borra imagen elsif (params[:op] == "addImage") then addImagenContenido #Añade imagen end end end The error: ----------------------------------------- Template is missing Missing template ./script/../config/../app/views/establishment_contents/llamada.rhtml Thank you -- 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 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 -~----------~----~----~----~------~----~------~--~---
Look in your Views directory. Do you see a Llamada folder with llamada.rhtml inside it? You shouldn''t because that is the file your app is looking for. You need to create a View template named llamada.rhtml for the information to appear in. On Oct 15, 12:05 pm, "Ramón Castro" <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > I need to make a form with two buttons. But I do wrong. And why not can > be. > > form: > ------------------------------- > <%= form_tag :controller => ''establishment_contents'', :action => > ''llamada'', :opMenu => opcionMenu %> > [...] > <%= image_submit_tag ("../images/incluir.gif", :op=>"addImage") %> > [...] > <%= image_submit_tag ("../images/eliminar.gif", :op=>"delImage") %> > <%= end_form_tag %> > > establishment_contents_controller.rb: > -------------------------------------- > def llamada > if (params[:op].nil?) then > if (params[:op] == "delImage") then > destroy #Borra imagen > elsif (params[:op] == "addImage") then > addImagenContenido #Añade imagen > end > end > end > > The error: > ----------------------------------------- > Template is missing > Missing template > ./script/../config/../app/views/establishment_contents/llamada.rhtml > > Thank you > -- > Posted viahttp://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 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 -~----------~----~----~----~------~----~------~--~---
Thanks for responding. But what I want is calling the method llamada in the controller. No llamada.rhtml. -- 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 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 -~----------~----~----~----~------~----~------~--~---
You''re welcome. Just try putting a file named llamada.rhtml in the establishment_contents folder and see what happens. Every time I get a "TEMPLATE MISSING" error, it has meant I have failed to create a file to contain the output of the method. On Oct 15, 1:00 pm, "Ramón Castro" <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Thanks for responding. > > But what I want is calling the method llamada in the controller. > No llamada.rhtml. > > -- > Posted viahttp://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 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 -~----------~----~----~----~------~----~------~--~---
the output needs a place to go. if you have a different view to display the results... user the render command render :action => "other_action_name" or render :partial => "other_action_partial On Oct 15, 2:15 pm, MrLipid <mrli...-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote:> You''re welcome. > > Just try putting a file named llamada.rhtml in the > establishment_contents folder and see what happens. > > Every time I get a "TEMPLATE MISSING" error, it has meant I have > failed to create a file to contain the output of the method. > > On Oct 15, 1:00 pm, "Ramón Castro" <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Thanks for responding. > > > But what I want is calling the method llamada in the controller. > > No llamada.rhtml. > > > -- > > Posted viahttp://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 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 -~----------~----~----~----~------~----~------~--~---
I got that I execute the method call. The problem was that The parameter op was not looking for and that there was no render ... Now my problem is to know how to send a parameter in a Image_submit_tag. It is possible? I command in each of the buttons a parameter op to know if A high or low. <=% Image_submit_tag ("../ images / incluir.gif ": op =>" addImage ")%> <=% Image_submit_tag ("../ images / eliminar.gif ": op =>" delImage ")%> How could we do? Thank you -- 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 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 -~----------~----~----~----~------~----~------~--~---
geshido-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Oct-17 07:31 UTC
Re: Form with two buttons
here:> def llamada > if (params[:op].nil?) then > if (params[:op] == "delImage") then > destroy #Borra imagen > elsif (params[:op] == "addImage") then > addImagenContenido #Añade imagen > end > end > endmaybe you wanted to use unless(params[:op].nil?) On Oct 16, 12:05 am, "Ramón Castro" <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > I need to make a form with two buttons. But I do wrong. And why not can > be. > > form: > ------------------------------- > <%= form_tag :controller => ''establishment_contents'', :action => > ''llamada'', :opMenu => opcionMenu %> > [...] > <%= image_submit_tag ("../images/incluir.gif", :op=>"addImage") %> > [...] > <%= image_submit_tag ("../images/eliminar.gif", :op=>"delImage") %> > <%= end_form_tag %> > > establishment_contents_controller.rb: > -------------------------------------- > def llamada > if (params[:op].nil?) then > if (params[:op] == "delImage") then > destroy #Borra imagen > elsif (params[:op] == "addImage") then > addImagenContenido #Añade imagen > end > end > end > > The error: > ----------------------------------------- > Template is missing > Missing template > ./script/../config/../app/views/establishment_contents/llamada.rhtml > > Thank you > -- > Posted viahttp://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 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 -~----------~----~----~----~------~----~------~--~---