I have a Rails 3 project in Aptana Studio 3 with a html.erb view file containing the following code:
<% if @books.blank? %>
<p>
There are not any books currently in the system.
</p>
<% else %>
<p>
These are the current books in our system
</p>
<ul id="books">
<% @books.each do |c| %>
<li>
<%= link_to c.title, {:action => 'show', :id => c.id} -%>
</li>
<% end %>
</ul>
<% end %>
<p>
<%= link_to "Add new Book", {:action => 'new' }%>
</p>
Then in the embedded terminal, I run rails server, click the "Run with Firefox Server" button in Aptana which opens the application with firefox, and directs me to this link: http://127.0.0.1:8020/library/app/views/book/book.html.erb
The problem is that I get this output:
<% if @books.blank? %>
There are not any books currently in the system.
<% else %>
These are the current books in our system
<% @books.each do |c| %>
<%= link_to c.title, {:action => 'show', :id => c.id} -%>
<% end %>
<% end %>
<%= link_to "Add new Book", {:action => 'new' }%>
Seems like the ruby code isn't getting evaluated but rather printed, however the syntax looks alright to me... Does anyone know what might be the problem?