Having a slight issue getting a simple param to constantize properly. The model is “BackTricks”.
This line is instantiating the variable fine with single word models, although in this particular situation it renders the variable as “Backtricks” without casing the second word properly. Any help would be greatly appreciated!
klass = params[:klass].to_s.capitalize.singularize.constantize
Use
titelizeinstead ofcapitalize