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
# Note model has a column, :important, :boolean, :default => false | |
# This goes in your HTML erb | |
<% @user.notes.find(:all, :order => 'updated_at DESC').each do |user_note| %> | |
<% remote_form_for user_note, {:url => | |
remote_toggle_important_user_note_path(:user_id => @user.id, :id => user_note.id)} do |f| %> | |
<%= f.check_box :important, :onclick => "$('edit_user_note_#{user_note.id}').onsubmit()" %><%= f.label :important %> | |
<% 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
#!/usr/bin/env ruby | |
# put this somewhere in your project, ie: /lib | |
# use: | |
# crontab -e | |
# */30 * * * * /usr/bin/ruby /your_rails_project/lib/this_file.rb | |
# that will insert this job into your delayed_job queue every 30 minutes. | |
require 'rubygems' | |
require 'mysql' |
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 'digest/md5' | |
class FbJsConnect | |
# When using the Facebook Javascript SDK to connect users to your site, | |
# a cookie will be placed in your applications session store. This class | |
# will verify your cookie, tell you if you're connected, and provide | |
# you with a User and other information | |
# | |
# cookie = cookies["fbs_YOUR FACEBOOK APP ID"] | |
# fb = FbJsConnect.new(cookie) |
NewerOlder