How to execute view code stored in string in run time with eval in rails 3.2 erb?
问题 What we are trying to do is to store a chunk of erb code in a string and then execute the code in run time . Here is a test we did : 1. take out a chunk of the code from a working erb file and, 2. rewrite the erb file with eval. Here is the chunk of erb code taken out: <tr> <th>#</th> <th><%= t('Date') %></th> <th><%= t('Project Name') %></th> <th><%= t('Task Name') %></th> <th><%= t('Log') %></th> <th><%= t('Entered By') %></th> </tr> <% @logs.each do |r| %> <tr> <td><%= r.id %></td> <td><%=