Skip to content

Commit

Permalink
Attachment funcionando
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheus Caceres authored and Matheus Caceres committed May 4, 2009
1 parent efbab42 commit 973c6a6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ public/rubyrun_rss/*
*.#*
config/deploy.rb
nbproject/*
public/system
3 changes: 1 addition & 2 deletions app/models/attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
class Attachment < ActiveRecord::Base
belongs_to :attachable, :polymorphic => true
has_attached_file :media,
:styles => { :medium => "300x300>",
:thumb => "100x100>" }
:styles => { :thumb => ["200x200#", :png] }
validates_attachment_presence :media

end
Expand Down
2 changes: 1 addition & 1 deletion app/views/attachments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<% @attachments.each do |attachment| %>
<tr>
<td><%=h attachment.attachable %></td>
<td><%=image_tag attachment.media.url(:thumb)%></td>
<td><%=h attachment.info %></td>
<td><%= link_to 'Show', attachment %></td>
<td><%= link_to 'Edit', edit_attachment_path(attachment) %></td>
Expand Down
Binary file removed public/system/medias/3/original/Imagem1.png
Binary file not shown.

0 comments on commit 973c6a6

Please sign in to comment.