Skip to content

Instantly share code, notes, and snippets.

View andrewhl's full-sized avatar

Andrew Hlavats andrewhl

View GitHub Profile
@alpha = User.where(:division => "Alpha")
position = @alpha.sort { |x,y| x.points <=> y.points }
ArgumentError: comparison of User with User failed
<!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) %>">
$(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
$(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 %>');
<%= link_to 'Update', 'success', :confirm => 'Are you sure?', :method => :update, :remote=>true, :class=>'update' %>
<div id="number_of_entries"><%= @number_of_entries %></div>
<%= link_to 'Update', 'success', :remote => true, :class=>'update' %>
<div id="number_of_entries"><%= @number_of_entries %></div>
<%= link_to 'Update', 'update', :remote => true, :class=>'update' %>
<div id="number_of_entries"><%= @number_of_entries %></div>
task :test do
puts User.all
end
<!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) {
# 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 %>