title: erb code is not working in javascript <script> tag
body: <p>I have Post table with title and content attributes. I want to make auto complete textfield where user are suggested by Post title. I am trying to add <a href="http://jqueryui.com/autocomplete/" rel="nofollow">jquery auto-complete</a> in my rails application. I am doing like this ..</p>
  
  <p>controller (Adding Posts title in Array)-- </p>
  
  <pre><code>  @posttitle = []
    Post.all.each do |g|
      @posttitle &lt;&lt; g.title 
    end
  </code></pre>
  
  <p>View --</p>
  
  <pre><code>  &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt;
    &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
    &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt;
  
    &lt;%= text_field_tag :search, params[:search], :placeholder =&gt; "Search Religious Places...", :id=&gt;"tags" %&gt;
  
   &lt;script&gt;
     $(function() {
     var availableTags = &lt;%= @posttitle %&gt;;
     $( "#tags" ).autocomplete({
     source: availableTags
     });
     });
   &lt;/script&gt;
  </code></pre>
  
  <p>But its not showing any suggestion (auto-complete is not working). I don't know whats going wrong. Please help</p>