css - Display data from database without being effected by html tags -


in database there html tags , such as

hello <br/> world 

and use following code in view display data:

 <span> @table.text </span> 

but problem data displayed break line , displayed hello world

and same problem happen other html tags such <a> tag or <img> tag. in other words, want display data database without change. how can solve problem ?

try this:

@html.raw("hello <br/> world".replace("<br/>","")) 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -