title: how to render all images of a certain category in cms page
body: <p>I am making a web page with ruby on rails and Comfortable Mexican Sofa.  I have uploaded a number of pictures and given them the category of: "smworker".  How do I render them on a cms page using a partial?  The following ugly mess works for my current images but I suspect that I am hard coding in information which is variable:</p>
  
  <pre><code>&lt;% @cms_site.files.images.for_category('smworker').each do |fl| %&gt;
    &lt;% my_src = "/system/cms/files/files/000/000/%03d/original/%s" % [fl.id, fl.file_file_name] %&gt;
    &lt;%= image_tag(my_src, class: "pic") %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>The object in question is <a href="https://github.com/comfy/comfortable-mexican-sofa/blob/master/app/models/cms/file.rb" rel="nofollow">Cms::File</a> which inherits from ActiveRecord::Base.  I assume that the database record contains info about the location of the file in the app file structure.</p>
  
  <pre><code>irb&gt; Cms::File.methods - ActiveRecord::Base.methods
  </code></pre>
  
  <p>yields a short list of seemingly irrelevant methods.  I suspect that ActiveRecord has some method (among the 100s) which returns the src but I have been unable to find it.  Suffice it to say that I am lost.  The images were uploaded with paperclip I guess.  Any help is greatly appreciated.  Please let me know if I could provide any other information which might be useful.</p>