Permalink
Browse files

post images are more generic

  • Loading branch information...
1 parent a3352af commit 81f21e6d027649babb05039d46b986f33c80f156 @pedropereira pedropereira committed Mar 20, 2012
@@ -41,7 +41,9 @@ class Post < ActiveRecord::Base
named_scope :filter_by_category, lambda { |category| { :conditions => { :global_category_id => category } } }
- has_attached_file :image, :styles => { :image => "250x250", :thumb => "50x50" }
+ post_image_size = (configatron.post_image_size) ? configatron.post_image_size : "250x250"
+
+ has_attached_file :image, :styles => { :image => post_image_size, :thumb => "50x50" }
has_attached_file :generic
before_save do |instance|
instance.image.clear if instance.image_delete == "1"
@@ -1,4 +1,5 @@
<% cache("post/#{post.id}") do %>
+<div id="post-<%= post.id %>" class="post">
<h2 class="title"><%= link_to(post.title, post_path(post)) %></h2>
<div class="textile-body">
<%= content_tag :div, link_to(image_tag(post.image.url(:image)), post.image.url(:original)), :class => 'post-image' if post.image? %>
@@ -49,4 +50,5 @@
<% end %>
</ul>
</div>
+</div>
<% end %>
@@ -13,9 +13,7 @@
<p><%= t('posts.none') %></p>
<% else -%>
<% @posts.each do |post| -%>
- <div id="post-<%= post.id %>" class="post">
- <%= render :partial => 'post', :locals => { :post => post, :event => nil } %>
- </div>
+ <%= render :partial => 'post', :locals => { :post => post, :event => nil } %>
<% end -%>
<% end -%>

0 comments on commit 81f21e6

Please sign in to comment.