Rails application helper did not support chinese characters
def top_cateogries_with_home(category_id=-1)
concat(raw "<select name='category_id' id='category_id'>")
container=[]
for category in Category.top
container.push([category.name,category.id])
end
concat(raw "<option value='-1' selected>首页</option>")
concat(raw options_for_select(container, selected = nil))
concat(raw "</select>")
end
I will write a helper method application_helper.rb, but this will cause a problem if the container symbol of China is 首页, if I replace them with a number or another symbol, this is normal.
I can use a comment with a Chinese character, but if I want to use in the helper, it throws an error, also in the database, chinse data can display with well,
hope someone can help me, thanks