How to use singularize method

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

like this

<%= params[:path].singularize %>

On Oct 22, 2:59 pm, Advait B. [email protected]

nas wrote:

like this

<%= params[:path].singularize %>

On Oct 22, 2:59 pm, Advait B. [email protected]

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

add this in between your rhtml tag

Add the above script after you have included your prototype.js file

Then use this in your body tag

where your_field is the id of the field where you want your cursor to
focus on page load

Hope this helps

On Oct 25, 2:16 pm, Advait B. [email protected]

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.