title: Reading a file in Rails Template
body: <p>I'm making a Rails template file as introduced below:</p>
  
  <ul>
  <li><a href="http://asciicasts.com/episodes/148-app-templates-in-rails-2-3" rel="nofollow noreferrer">http://asciicasts.com/episodes/148-app-templates-in-rails-2-3</a></li>
  </ul>
  
  <p>I have a big file I want to make, so instead of doing:</p>
  
  <pre><code>file "bigfile.txt", &lt;&lt;-EOF
    content of the file...
  EOF
  </code></pre>
  
  <p>I want to read the content from another file. What I have now is:</p>
  
  <pre><code>file "public/stylesheets/sass/960.sass", File.read(File.expand_path(File.join(File.dirname(__FILE__), "960.sass")))
  </code></pre>
  
  <p>The file is located in the same directory as the rails template file. The problem is: when I try to make a rails app with the template (i.e., <code>rails new_app -m rails_template/rails_template.rb</code>, I get the following error:</p>
  
  <pre><code>The template [rails_template/rails_template.rb] could not be loaded. Error: (eval):129:in `read': No such file or directory - /Users/myusername/Desktop/new_app/960.sass
  </code></pre>
  
  <p>This is all because <code>__SELF__</code> is not working the way I expected. I expect <code>__SELF__</code> to be the template file itself, but in reality, <code>__SELF__</code> is poiting to the root of the app or somewhere else.</p>
  
  <p>Is there a way to load file in a rails template?</p>