Hello I need to know how to make use of singularize method with params[:path], the code is something like this <%= params[:path] %> , the output of this particular statement is computers and I need to get computer. Thank you Advait -- 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 -~----------~----~----~----~------~----~------~--~---
like this <%= params[:path].singularize %> On Oct 22, 2:59 pm, Advait Bellur <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello > > I need to know how to make use of singularize method with params[:path], > > the code is something like this > > <%= params[:path] %> , the output of this particular statement is > computers and I need to get computer. > > Thank you > > Advait > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
nas wrote:> like this > > <%= params[:path].singularize %> > > On Oct 22, 2:59 pm, Advait Bellur <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Respected sir, I tried out and it worked fine, I have another issue related to using java scripts in rhtml," focusing issue ",that is when ever I load a web page my cursor should start blinking on the first text field. I need to know a method to use it individually for rhtms and partials , as I tried out using prototype.js method. ANY HELP IN THIS MATTER WILL BE VERY VERY HELPFULL Regards Advait -- 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 -~----------~----~----~----~------~----~------~--~---
add this in between your rhtml tag <script type="text/javascript"> function setfocus(field_to_focus) { $(field_to_focus).focus() } </script> Add the above script after you have included your prototype.js file Then use this in your body tag <body onload="setfocus(''your_field'');"> where your_field is the id of the field where you want your cursor to focus on page load <input name="customer" id="your_field" /> Hope this helps On Oct 25, 2:16 pm, Advait Bellur <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> nas wrote: > > like this > > > <%= params[:path].singularize %> > > > On Oct 22, 2:59 pm, Advait Bellur <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > Respected sir, > > I tried out and it worked fine, > > I have another issue related to using java scripts in rhtml," focusing > issue ",that is when ever I load a web page my cursor should start > blinking on the first text field. > > I need to know a method to use it individually for rhtms and partials , > as I tried out using prototype.js method. > > ANY HELP IN THIS MATTER WILL BE VERY VERY HELPFULL > > Regards > > Advait > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
a correction on the first line for the above post add this in your rhtml file or in between your layout''s head tag i.e. <head></head> On Oct 31, 1:17 pm, nas <nasi...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> add this in between your rhtml tag > <script type="text/javascript"> > function setfocus(field_to_focus) { > $(field_to_focus).focus() > } > </script> > Add the above script after you have included your prototype.js file > > Then use this in your body tag > <body onload="setfocus(''your_field'');"> > > where your_field is the id of the field where you want your cursor to > focus on page load > <input name="customer" id="your_field" /> > > Hope this helps > > On Oct 25, 2:16 pm, Advait Bellur <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > nas wrote: > > > like this > > > > <%= params[:path].singularize %> > > > > On Oct 22, 2:59 pm, Advait Bellur <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > > Respected sir, > > > I tried out and it worked fine, > > > I have another issue related to using java scripts in rhtml," focusing > > issue ",that is when ever I load a web page my cursor should start > > blinking on the first text field. > > > I need to know a method to use it individually for rhtms and partials , > > as I tried out using prototype.js method. > > > ANY HELP IN THIS MATTER WILL BE VERY VERY HELPFULL > > > Regards > > > Advait > > > -- > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---