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
class LeftBoxInput < SimpleForm::Inputs::Base | |
def input | |
"<div class='input-prepend'><span class='add-on'>#{options[:symbol]}</span>#{@builder.text_field(attribute_name, input_html_options)}</div>".html_safe | |
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
class PrependCheckboxInput < SimpleForm::Inputs::Base | |
def input | |
"<div class='input-prepend'> | |
<label class='add-on active' title='#{options[:tooltip]}' rel='tooltip' > | |
#{@builder.check_box(attribute_name.to_s + '_check')} | |
</label> | |
#{@builder.text_field(attribute_name, input_html_options)} | |
<span class='help-inline'> | |
#{options[:help]} | |
</span> |
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
[ pid=29556 thr=140539690551104 file=ext/apache2/Hooks.cpp:865 time=2011-08-04 16:42:49.371 ]: Unexpected error in mod_passenger: An error occurred while receiving HTTP upload data: The timeout specified has expired (70007) | |
Backtrace: | |
in 'boost::shared_ptr<Passenger::BufferedUpload> Hooks::receiveRequestBody(request_rec*)' (Hooks.cpp:1293) | |
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:566) |
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
# For finding images as in Article.attachments.images | |
scope :images, where("file_content_type LIKE ?", "image%") | |
# For finding other files Article.attachments.docs | |
scope :docs, where("file_content_type NOT LIKE ?", "image%") |
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
require 'open-uri' | |
def roulette(bet) | |
open('http://roulette.engineyard.com/').read.match("13") ? 35 * bet : 0 | |
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
gateway.transfer 1000, '[email protected]', | |
:subject => "The money I owe you", :note => "Sorry it's so late" | |
gateway.transfer [1000, '[email protected]'], | |
[2450, '[email protected]', :note => 'You will receive another payment on 3/24'], | |
[2000, '[email protected]'], | |
:subject => "Your Earnings", :note => "Thanks for your business." |
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
[404, {"Content-Type" => "text/html"}, ["Not Found"]] |
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
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails) |
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
// Es de Yahoo, pero puedes cambiarlo a cualquier pagina que publique el tipo de cambio | |
mx_rate = YahooCurrency.get_rate!("USD", "MXN") | |
sub_number_to_currency(@product.price * mx_rate.rate) |
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
<% form_for @offer do |f| %> | |
<%= f.label :version, 'Version' %>: | |
<%= f.text_field :version %><br /> | |
<%= f.label :author, 'Author' %>: | |
<%= f.text_field :author %><br /> | |
<% end %> |