This file contains hidden or 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
<div id="grid"></div> |
This file contains hidden or 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
$ -> | |
$.rails.confirm = (message) -> | |
answer = $.Deferred(); | |
modal = $ """ | |
<div class="modal hide fade"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h3>Delete</h3> | |
</div> |
This file contains hidden or 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
<!doctype html> | |
<html><head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> | |
<script type='text/javascript' src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script> | |
<script type='text/javascript' src="http://cloud.github.com/downloads/emberjs/ember.js/ember-latest.js"></script> | |
</head><body> | |
<script type="text/x-handlebars" data-template-name="application"> | |
<h1>Application</h1> | |
<a href="#/dashboard">Dashboard</a> |
This file contains hidden or 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
1) Error: | |
test_coerced_test_delete_all_with_join(DeleteAllWithJoinTest): | |
ActiveRecord::StatementInvalid: TinyTds::Error: The multi-part identifier "posts.author_id" could not be bound.: EXEC sp_executesql N'DELETE FROM [people] WHERE [posts].[author_id] IS NULL; SELECT @@ROWCOUNT AS AffectedRows' |
This file contains hidden or 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 screen_shot_and_save_page | |
require 'capybara/util/save_and_open_page' | |
path = "/#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}" | |
Capybara.save_page body, "#{path}.html" | |
page.driver.render Rails.root.join "#{Capybara.save_and_open_page_path}" "#{path}.png" | |
end | |
begin | |
After do |scenario| | |
screen_shot_and_save_page if scenario.failed? |
This file contains hidden or 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 tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
This file contains hidden or 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
diff --git a/lib/inherited_resources/base_helpers.rb b/lib/inherited_resources/base_helpers.rb | |
index ccdf7ae..e94d875 100644 | |
--- a/lib/inherited_resources/base_helpers.rb | |
+++ b/lib/inherited_resources/base_helpers.rb | |
@@ -73,6 +73,15 @@ module InheritedResources | |
# | |
def update_resource(object, attributes) | |
object.update_attributes(attributes) | |
+ attributes.keys.each do |key| | |
+ key.match(/^(?<association_name>\w+)_attributes$/) |
This file contains hidden or 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
diff --git a/lib/simple_form/form_builder.rb b/lib/simple_form/form_builder.rb | |
index c8e8e22..4610f7c 100644 | |
--- a/lib/simple_form/form_builder.rb | |
+++ b/lib/simple_form/form_builder.rb | |
@@ -242,6 +242,11 @@ module SimpleForm | |
SimpleForm::ErrorNotification.new(self, options).render | |
end | |
+ def wrapper(css_class, &block) | |
+ options[:wrapper_class] = css_class.to_s |
This file contains hidden or 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
ruby-1.9.2-p0 > s = Site.first | |
EXECUTE (0.6ms) USE [mpp_admin_dev] | |
Site Load (0.4ms) SELECT TOP (1) [sites].* FROM [sites] | |
=> #<Site id: 1, domain_id: nil, content_id: nil, name: "realtime", course_name: nil, ga_code: nil, webshop_url: nil, created_at: "2010-12-08 12:12:41", updated_at: "2010-12-08 12:38:08", published_at: nil, deleted_at: nil> | |
ruby-1.9.2-p0 > s.name = 'realtime2' | |
=> "realtime2" | |
ruby-1.9.2-p0 > s.save | |
EXECUTE (0.5ms) BEGIN TRANSACTION | |
EXECUTE (1.0ms) UPDATE [sites] SET [name] = N'realtime2', [updated_at] = '2010-12-08 12:57:50.514' WHERE ([sites].[id] = 1) | |
{"content_id"=>nil, "course_name"=>nil, "created_at"=>2010-12-08 12:12:41 UTC, "domain_id"=>nil, "ga_code"=>nil, "name"=>"realtime2", "updated_at"=>2010-12-08 12:57:50 UTC, "webshop_url"=>nil} |
This file contains hidden or 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
$(document).ready(function() { | |
// Define the dateFormat for the datepicker | |
$.datepicker._defaults.dateFormat = 'dd M yy'; | |
/** | |
* Sets the date for each select with the date selected with datepicker | |
*/ | |
$('input.ui-date-text').live("change", function() { | |
var sels = $(this).siblings("select:lt(3)"); | |
var d = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $(this).val() ); |