Rails 3: How to display properly text from “textarea”?

前端 未结 9 1352
予麋鹿
予麋鹿 2021-01-31 15:31

In my Rails 3 application I use textarea to let users to write a new message in a forum.

However, when the message is displayed, all newlines look like spac

9条回答
  •  别跟我提以往
    2021-01-31 16:17

    I was using Ace code-editor in my rails app and i had problem, that whenever i update or create the code, it adds always extra TAB on every line (except first). I couldn't solve it with gsub or javascript replace.. But it accidently solved itself when i disabled layout for that template.

    So, i solved it with

    render :layout => false
    

提交回复
热议问题