user108031
user108031

Reputation: 35

Escaping Characters Rails

I want to escape the inputs to this form so that when its enter in the database characters like .'* won't affect the update. How would I encode the characters to achieve the goal stated above.

<% form_for @post, :url => {:action => :createInnovation } do |form| %> 
  <fieldset>
    <p> Title: <br/><%= form.text_field :title, :html => {:class => "text ui-widget_content ui-corner-all" } %> </p>
    <p> Description: <br/> <%= form.text_area :body, :html => {:class => "text ui-widget_content ui-corner-all" } %> </p>
  </fieldset>
<%end%>

Upvotes: 0

Views: 627

Answers (1)

wgpubs
wgpubs

Reputation: 8261

ActiveRecord will automatically escape any characters as needed to prevent sql injection. Is that what you're concerned about? If so, Rails has you covered.

Upvotes: 4

Related Questions