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
class BurritoDeliciousPolicy | |
def delicious?(burrito) | |
burrito.guacamole? | |
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
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script> | |
<script> | |
//<![CDATA[ | |
window.jQuery || document.write("<script src='/javascripts/jquery.min.js'>\x3C/script>") | |
//]]> | |
</script> |
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
:vimgrep regex path | |
#example to find all ruby files using "belongs"to | |
:vimgrep /belongs_to/ **/*.rb | |
:cnext | |
:cprevious |
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
/* flash-messages | |
#flash | |
left: 0 | |
margin: 0 auto | |
position: absolute | |
text-align: center | |
top: 0 | |
width: 100% | |
z-index: 1000 |
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
# Condition Builder for ActiveRecord | |
# | |
# (c) 2005-2006 Ezra Zygmuntovic, Jens-Christian Fischer and Duane Johnson | |
# distributed under the same license as Ruby On Rails | |
# | |
# Version 1.1 | |
# | |
# Jan 4, 2007: Added "AND" and "OR" using 'and' and 'or'. Also added ability to use sub-conditions | |
# e.g. | |
# Condition.block { |c| |
NewerOlder