html - string in Ruby on rails questions: 1. <code> 2. how to recognize "put"? -


i'm developing web application ruby on rails.

when command

<h4>wow webpage <code>loving each other</code> good</h3> 

, "loving each other" part highlighted ( , meant because learned code can work through getbootstrap! ) : "code" "code" <---- in stackoverflow page code code command working put here intentionally in wrong way.

i wanted make specific string data that. in application, string data

<textarea class = "form-control" name="input"></textarea> 

but when displayed in html, <code> part not recognized sort of code string. partially seems make sense not understood. how can turn type of information formatted version ( meaning part highlighted! )

second question that, string data got <textarea> has "entering actions" meaning, user clicks "enter" couple of times. when display information (for instance, @a = user.information, <- user.information has couple of sentences equal information ), enters don't appear , sentences messy :(

i think there sure way properly!!! looking forward hearing opinion experts!

while rendering should this:

"<h4>wow webpage <code>loving each other</code> good</h3>".gsub('\n','<br/>).html_safe 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -