rendering-plain-text

Ruby-on-rails: rendering text and html within ruby tags only renders one line

I have the following code in a partial view file: "_status.html.erb" <%= if session[:user].nil? "welcome new user" link_to( 'Sign in', login_path) else render ( :text => "user name:") h(session[:user].name) end %> But I only see the values of: session[:user].name (not the text "use...

How to display code in plain text?

What previous result you are referencing:(Optional) function getSize() { var myFSO = new ActiveXObject("Scripting.FileSystemObject"); var filepath = document.upload.file.value; var thefile = myFSO.getFile(filepath); var size = thefile.size; alert(size + " bytes"); } A user input some Javascript code, but the code can not be...