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
# within the else block in paths.rb: | |
path_method = page_name.gsub(/^(the|my) /i, '').gsub(/ page$/i, ' path').gsub(/\s+/, '_') | |
begin | |
send(path_method.to_sym) | |
rescue | |
raise "Can't find mapping from \"#{page_name}\" to a path.\n" + | |
"Now, go and add a mapping in #{__FILE__}" | |
end |
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
Spec::Runner.configure do |config| | |
config.before do | |
subscriber = mock(RSpreedly::Subscriber) | |
subscriber.stub!(:save) | |
RSpreedly::Subscriber.stub!(:new).and_return(subscriber) | |
end | |
end |
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
export PATH=$PATH:/Users/aeden/.gem/ruby/1.8/bin | |
alias gst='git status ' | |
alias gc='git commit ' | |
alias gca='git commit -a ' | |
alias ga='git add ' | |
alias gco='git checkout ' | |
alias gb='git branch ' | |
alias gm='git merge ' | |
alias gp='git push ' |
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
system: | |
uname: "Darwin Anthony-Edens-MacBook-Pro.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386" | |
shell: "bash" | |
version: "3.2.48(1)-release" | |
ruby: | |
interpreter: "ruby" | |
version: "1.8.7" | |
date: "2010-01-10" | |
platform: "i686-darwin10.2.0" |
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
/Users/aeden/.rvm/bin:/Users/aeden/.rvm/bin:/Users/aeden/.rvm/rubies/ruby-1.8.7-p249/bin:/Users/aeden/.rvm/gems/ruby-1.8.7-p249/bin:/Users/aeden/.rvm/gems/ruby-1.8.7-p249%global/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/aeden/.gem/ruby/1.8/bin |
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
system: | |
uname: "Darwin Anthony-Edens-MacBook-Pro.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386" | |
shell: "bash" | |
version: "3.2.48(1)-release" | |
ruby: | |
interpreter: "ruby" | |
version: "1.8.7" | |
date: "2009-12-24" | |
platform: "i686-darwin10.2.0" |
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
$('ul.people').append('<li><span class="name">' + | |
html_sanitize(json.person.name) + '</span> <a href="/people/' + | |
json.person.id + '/delete" class="delete">delete</a></li>'); |
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
<li><span class="name"><%= h person.name %></span> | |
<%= link_to 'delete', delete_person_path(person), :class => 'delete' %> | |
</li> |
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
git clone git://github.com/aeden/unobtrusive-jquery-example.git | |
cd unobtrusive-jquery-example | |
script/server |
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
connectDeleteLinks: function() { | |
$('ul.people').find('a.delete').live('click', function() { | |
var li = $(this).parent(); | |
if (confirm('Are you sure you want to delete the person "' + li.find('span.name').text() + '"?')) { | |
$.ajax({ | |
type: 'post', | |
dataType: 'json', | |
url: this.href.replace(/\/delete/, ''), | |
data: {'_method': 'delete'}, | |
success: function(json) { |