Yuming Ren Curious and Learning 平平无奇

Ruby work note

2017-08-28
yuming

common statements

array 内元素大小写

array.map(&:upcase) # to Upper case
array.map(&:downcase) # to down case

How can I uppercase each element of an array?

show parameter inpect without HTML entitiies

In view, just use <%= raw parameter.inspect %> For example, we pass a @user parameter to the view, the @usr = “;nbsp”, it will put a “ “ instead.

url parameters

request.request_uri request.fullpath request.path https://stackoverflow.com/questions/2165665/how-do-i-get-the-current-absolute-url-in-ruby-on-rails


上一篇 Linux Cmds

Comments

Content