How to use singularize method

like this

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

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

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>