一連の変数がリストされた .erb ファイルを作成しました。
<body>
<h1>
<%= header %>
</h1>
<p>
<%= intro1 %>
</p>
<p>
<%= content1 %>
</p>
<p>
<%= content2 %>
</p>
<p>
<%= content3 %>
</p>
</body>
次に、変数を含むテキスト ファイルがあります。
header=This is the header
intro1=This is the text for intro 1
content1=This is the content for content 1
content2=This is the content for content 2
content3=This is the content for content 3
テキスト ファイルから変数を取得し、.erb テンプレートに挿入する必要があります。これを行う適切な方法は何ですか?Railsサイト全体ではなく、Rubyスクリプトだけを考えています。小さなページのみですが、複数回実行する必要があります。
ありがとう