I have a requirement where I need to make links clickable in text while keeping any other html tags as text (not html_safe). This means I cannot make ...
I have a requirement where I need to make links clickable in text while keeping any other html tags as text (not html_safe). This means I cannot make ...
I need to embed a JSON object into an HTML data attribute. Using the Ruby to_json generates a proper JSON string, but it is not escaped. So I get t ...
We're building a Chat service, which people are able to use from within their code. Amongst the tools we're building, we've made a Ruby gem to allow ...
I have a simple RSS feed for a website I'm trying to build. I want to do a read more link for posts and limit the output to 300 characters. My code lo ...
Example: If we store <script>alert(299792458)</script> as a first name input, the value is getting accepted and stored. When we display t ...
I'm having a problem rendering a partial in a bootstrap popover in my rails app. The partial is always rendered as a plain text( showing all the H ...
I would like to add a bootstrap styling to my f.submit button with ruby on rails form helpers. But the code below not working for me. Does anyone have ...
I'm using Rspec and the gem file_validators for testing and I need to put properly the output of the Quote Marks ("txt") like theses: or But I'm ...
I am trying to use .html_safe in the below description where I receive the error as Undefined method for Nokogiri HTML document. blogs_controller.rb ...
So I am stuck with a small issue while migrating a legacy project from Rails 3.2 to 4.2 Inside one of our views (erb), the code (Rails 3.2) produce ...
I used html_safe, raw and also sanitize. But I still characters like \r \n — this is because i use "return/enter" key in Mac to go to next line when i ...
How can render HTML content from database in a prawn document The output i am getting from the above code is a string with HTML tags. I want someth ...
I am trying to figure out the best way to make my meta tags html safe. They are currently escaping out any html. Here is my current setup. in my ap ...
I use og:description meta tag like this But it shows description of post in top of the page. ...
I have an array of strings declared in my controller that I need to use in a js file. Here is my code: The puts returns: I now need to use the a ...
I was wondering when it is safe to use html_safe and when not. I read that you don't want to do this if the code may contain user content. What does t ...
I am trying to use the html_safe? method to check if a string/text which is retrieved from the DB contains any HTML. However, the html_safe? method is ...
I'm using flash message with laravel to display notification to users. I want to include html tags in my message. For example: Flash::overlay('Votre c ...
I Have a rendering of a partial that should be outputted to a div that is not displayed correctly. I tried in my index.js.haml : and they are all o ...
How can we give the user the ability to break-lines here? <%= f.text_area :name, rows: 4, class: 'form-control', id: "gold-standard", placeholder: ...