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
article = insert! Article | |
comment = insert! Comment, :article => article | |
# ...use these records here... |
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
article = Article.new { |a| a.save(false) } | |
comment = article.comments.build { |c| c.save(false) } |
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
article = Article.new.save(false) # would be ideal, but `article' equals true here | |
article = Article.new | |
article.save(false) # => true | |
comment = article.comments.build | |
comment.save(false) # => true | |
# ...use these records here... |
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
text "Hello World!" |
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
pdf.text "Hello World!" |
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
pdf.bounding_box [100, 600], :width => 200 do | |
pdf.text "The rain in spain falls mainly on the plains " * 5 | |
pdf.stroke do | |
pdf.line pdf.bounds.top_left, pdf.bounds.top_right | |
pdf.line pdf.bounds.bottom_left, pdf.bounds.bottom_right | |
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
bounding_box [100, 600], :width => 200 do | |
text "The rain in spain falls mainly on the plains " * 5 | |
stroke do | |
line bounds.top_left, bounds.top_right | |
line bounds.bottom_left, bounds.bottom_right | |
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
def show | |
# ... | |
send_file_headers! \ | |
:disposition => 'attachment', :filename => "foo-#{@foo.to_param}.pdf", | |
:type => Mime::PDF, :length => false | |
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
some.code(before) | |
eval(Pathname(__FILE__).dirname.join('_bar.pdf.prawn').read) | |
some.code(after) |
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
From 3014a599a158c7ef1332bf3dbc6ca25c015c618e Mon Sep 17 00:00:00 2001 | |
From: Roman Le Negrate <[email protected]> | |
Date: Mon, 22 Dec 2008 22:30:20 +0100 | |
Subject: [PATCH] only include acts-like-git specific modules when versioning gets configured | |
--- | |
lib/acts_like_git.rb | 7 +------ | |
lib/acts_like_git/active_record_ext/base.rb | 4 ++++ | |
2 files changed, 5 insertions(+), 6 deletions(-) | |