Since I'm using Paperclip, I will ask as follows:

I have the following in my model and view. What should I place instead 
of ????? in the view (show.html.erb)?

*Model:

class Dicom < ActiveRecord::Base
  has_attached_file :photo, :styles => {:original => ["100%", :jpg]}

  def getHeight()
    uploaded_file = photo.queued_for_write[:original]
    dimensions = Paperclip::Geometry.from_file(uploaded_file)
    height = dimensions.height
    return height
  end

  def getWidth()
    uploaded_file = photo.queued_for_write[:original]
    dimensions = Paperclip::Geometry.from_file(uploaded_file)
    width = dimensions.width
    return width
    end
  end

* View:

<%= javascript_include_tag "coordinate" %>
<canvas id="draw"  height= "<%=????? %>" width="<%=????? %>" >
</canvas>
<p id="notice"><%= notice %></p>
<p>
<b> Name </b>
<%= @dicom.name %>
</p>
<p>
<b> Image </b>
</p>
<div id="image_element" style="display: none;">
<p>
<%= image_tag @dicom.photo.url , :id => 'dicom_image' %>
</p>
</div>
<%= update_page_tag do |page|
page << "drawImg();"
end
%>
<%= update_page_tag do |page|
page << "drawLine();"
end
%>
<%= link_to 'Edit', edit_dicom_path(@dicom) %>
<%= link_to 'Back', dicoms_path %>
-- 
Posted via http://www.ruby-forum.com/.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to