How about something like this:

attr_reader :size

Sizes = {:small => '5x5'
                :large => '1000x1000'}

def get_preview(size)
  ...
  ...
end

def small_preview
  @small ||= get_preview(Sizes[:small])
  @size = Sizes[:small]
end

def large_preview
  @large ||= get_preview(Sizes[:large])
  @size = Sizes[:large]
end


<%= image_tag medium.small_preview, :size => medium.size %>

-- 
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