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
@alpha = User.where(:division => "Alpha") | |
position = @alpha.sort { |x,y| x.points <=> y.points } | |
ArgumentError: comparison of User with User failed |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Site</title> | |
<%= stylesheet_link_tag "application" %> | |
<%= javascript_include_tag "application" %> | |
<%= javascript_include_tag "success" %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body class="<%= yield(:class) %>"> |
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
$(document).ready(function() { | |
$('#my-link').click(function(event){ | |
alert('Hooray!'); | |
event.preventDefault(); // Prevent link from following its href | |
}); | |
twttr.ready(function (twttr) { | |
twttr.events.bind('tweet', function(event) { | |
// Do something there |
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
$(document).ready(function() { | |
$('#my-link').click(function(event){ | |
alert('Hooray!'); | |
event.preventDefault(); // Prevent link from following its href | |
}); | |
twttr.ready(function (twttr) { | |
twttr.events.bind('tweet', function(event) { | |
$('.twitter-share-button').append('<% @user = User.find(params[:id]); @user.twitter_flag = true; @user.save %>'); |
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 'Update', 'success', :confirm => 'Are you sure?', :method => :update, :remote=>true, :class=>'update' %> | |
<div id="number_of_entries"><%= @number_of_entries %></div> |
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 'Update', 'success', :remote => true, :class=>'update' %> | |
<div id="number_of_entries"><%= @number_of_entries %></div> |
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 'Update', 'update', :remote => true, :class=>'update' %> | |
<div id="number_of_entries"><%= @number_of_entries %></div> |
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
task :test do | |
puts User.all | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Taste of Nature</title> | |
<%= stylesheet_link_tag "application" %> | |
<%= javascript_include_tag "application" %> | |
<%= csrf_meta_tags %> | |
<script type="text/javascript" charset="utf-8"> | |
window.twttr = (function (d,s,id) { |
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
# included on /divisions/index.html.erb | |
<%= form_for @division, :remote => true, :method => :post, :html => {:id => "division_form"} do |f| %> | |
<div class="field"> | |
<%= f.text_area :division_name %> | |
</div> | |
<div class="actions"> | |
<%= f.submit %> | |
</div> | |
<% end %> |