23 Jul 00:36
Image Tags
From: tICT <teachICT@...>
Subject: Image Tags
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-22 22:38:23 GMT
Subject: Image Tags
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-22 22:38:23 GMT
is it possible to display 'local' images in the format src="file:///E:/
StudentWork/screenshots/AO1_review.png" where the source is a text
field in a table? seems like I can generate the code ok, but the image
won't display....
InstantRails on XP running Rails 2.0.2 and Ruby 1.8.6
code for index.html.erb is ....
<% for task in @tasks %>
<tr>
<td><img style="width:160px; height:120px;" src="file:///<%=
task.path %>" /></td>
<td><%=h task.title %></td>
<td><%=h task.description %></td>
<td><%= link_to 'Show', task %></td>
<td><%= link_to 'Edit', edit_task_path(task) %></td>
<td><%= link_to 'Destroy', task, :confirm => 'Are you
sure?', :method => :delete %></td>
</tr>
<% end %>
where <%= task.path %> is the field containing the image path
Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
(Continue reading)
RSS Feed