I am trying to simply add a '/' at the end of this string. What is the best way to do this?
>> params[:id]
"shirts"
params[:id] == "shirts/"
/
Simplest:
params[:id] = params[:id] + '/'
or
params[:id] += '/'
Moar fancy:
params[:id] << '/'
Yet another way to do this:
params[:id].concat '/'
If you really really for some bizzare reason insist on gsub:
params[:id].gsub! /$/, '/'