views:

113

answers:

1

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%>
+3  A: 

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.

wgpubs