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
$("form#new_note").bind("ajax:success", function(xhr, data, status){ | |
// this is where the success stuff goes | |
}); |
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
# See http://help.github.com/ignore-files/ for more about ignoring files. | |
# | |
# If you find yourself ignoring temporary files generated by your text editor | |
# or operating system, you probably want to add a global ignore instead: | |
# git config --global core.excludesfile ~/.gitignore_global | |
# Ignore bundler config | |
/.bundle | |
# Ignore the default SQLite database. |
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
jQuery.fn.limitMaxlength = function(options){ | |
var settings = jQuery.extend({ | |
attribute: "maxlength", | |
onLimit: function(){}, | |
onEdit: function(){} | |
}, options); | |
// Event handler to limit the textarea | |
var onEdit = function(){ |
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
class CreateAttributes < ActiveRecord::Migration | |
def change | |
end | |
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
heroku config:add DATABASE_URL=mysql2://username:password@ip.goes.here/data_base_name --app heroku-app-name |
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
<%-- This block checks the number of items in a contentloop | |
---------------------------------------------------------------------------------- --%> | |
<cms:contentaccess var="content" scope="page" /> | |
<c:set var="count" value="${fn:length(content.valueList['Bottom'])}" /> | |
<%-- End the check | |
----------------------------------------------------------------------------------- --%> |
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
class ApplicationController < ActionController::Base | |
helper_method :current_account, :current_user # you may have others that go here too | |
private | |
# I added this so that way I can just use current_account just like current_user | |
def current_account | |
@current_account = Account.find_by_subdomain(request.subdomain) | |
return @current_account |
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
class ApplicationController < ActionController::Base | |
helper_method :current_account, :current_user # you may have others that go here too | |
private | |
# I added this so that way I can just use current_account just like current_user | |
def current_account | |
@current_account = Account.find_by_subdomain(request.subdomain) | |
return @current_account |
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
class UserSessionsController < ApplicationController | |
def new | |
@user_session = current_account.user_sessions.build | |
end | |
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
class Account < ActiveRecord::Base | |
has_many :users | |
authenticates_many :user_sessions, :scope_cookies => true | |
# Other code by you | |
end |