This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simply run <%= breadcrumbs(separator, options) %> | |
def breadcrumbs(separator = ' > ', options = {}) | |
(crumbs, previous) = [], [] | |
request.path.split('/').each do |part| | |
previous << part | |
crumbs << link_to(part, previous.join('/'), options) | |
end | |
crumbs.join(separator) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= link_to 'Back', [:admin, @parent, :albums] %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def link_to_actors(actors, options = {}) | |
actors.map{ |a| link_to(a.full_name, actors_path(a), options) }.to_sentence | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= link_to_actors(@movie.actors, :class => 'actor') %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake paperclip:refresh CLASS=Photo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delete(name, options = nil) | |
super | |
File.delete(real_file_path(name)) | |
rescue SystemCallError => e | |
# If there's no cache, then there's nothing to complain about | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveSupport::Cache::FileStore.class_eval do | |
def delete(name, options = nil) | |
puts "Real Filename: #{real_file_path(name)}" | |
super | |
File.delete(real_file_path(name)) | |
rescue SystemCallError => e | |
puts "Failed to delete cache. #{e.message}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<studio> | |
<created-at type="datetime">2009-06-18T17:02:49Z</created-at> | |
<description>A Studio Description Here</description> | |
<id type="integer">1</id> | |
<photo-content-type>image/jpeg</photo-content-type> | |
<photo-file-name>jaws.jpg</photo-file-name> | |
<photo-file-size type="integer">833900</photo-file-size> | |
<photo-updated-at type="datetime">2009-06-18T17:02:48Z</photo-updated-at> | |
<state>active</state> | |
<title>Some Title Here</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def to_xml(options = {}, &block) | |
thumbs = Proc.new do |opts| | |
[:large, :thumb, :icon].each do |style| | |
opts[:builder].tag!("thumbnail-#{style}", self.photo.url(style, false)) | |
end | |
end | |
default_options = { | |
:procs => [thumbs], | |
:except => [:photo_file_name, :photo_file_size, :photo_content_type, :photo_updated_at] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<studio> | |
<created-at type="datetime">2009-06-18T17:02:49Z</created-at> | |
<description>A Studio Description Here</description> | |
<id type="integer">1</id> | |
<state>active</state> | |
<title>Some Title Here</title> | |
<titles-count type="integer">0</titles-count> | |
<updated-at type="datetime">2009-06-18T17:02:49Z</updated-at> | |
<url>http://www.google.com</url> | |
<thumbnail-large>/content/studios/photos/1/large_jaws.jpg</thumbnail-large> |
OlderNewer