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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
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
<% vendor_prefixes = ['-moz-', '-webkit-', '-o-', '-ms-', ''] %> | |
@mixin carbon { | |
<% vendor_prefixes.each do |prefix| %> | |
<%= "background: | |
#{prefix}linear-gradient(63deg, #151515 5px, transparent 5px) 0 5px, | |
#{prefix}linear-gradient(243deg, #151515 5px, transparent 5px) 10px 0px, | |
#{prefix}linear-gradient(63deg, #222 5px, transparent 5px) 0px 10px, | |
#{prefix}linear-gradient(243deg, #222 5px, transparent 5px) 10px 5px, | |
#{prefix}linear-gradient(0deg, #1b1b1b 10px, transparent 10px), |
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
/* First Draft */ | |
background-size: 20px 20px; | |
background-position: 0px 5px, 10px 0px, 0px 10px, 10px 5px, | |
0px 15px, 10px 10px, 0px 20px, 10px 15px, | |
10px 5px, 0px 0px, 10px 10px, 0px 5px, | |
10px 15px, 0px 10px, 10px 20px, 0px 15px; | |
background-image: | |
linear-gradient(63deg, #131313 5px, transparent 5px), |
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
<p> | |
<span id="editable"></span> | |
<a href="#" id="externalcontrol">click to edit</a> | |
</p> | |
<script> | |
// <![CDATA[ | |
new Ajax.InPlaceRichEditor($('editable'), URL, { | |
editOnBlank: false, | |
externalControl: $('externalcontrol')}, | |
TINYMCE_OPTIONS |
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
new Ajax.InPlaceRichEditor($('EDITOR_ID'), 'URL', { | |
externalControl: 'EXTERNAL_CONTROL_ID' | |
}); |
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
package "app-misc/wkhtmltopdf-bin" do | |
version "0.10.0_beta5" | |
action :install | |
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
check process <%= @worker_name %> | |
with pidfile /data/<%= @app_name %>/shared/pids/delayed_job.<%= @worker_count %>.pid | |
start program = "/bin/bash -c 'cd /data/<%= @app_name %>/current/;RAILS_ENV=<%= @framework_env %> script/delayed_job start -i <%= @worker_count %>'" with uid deploy and gid deploy with timeout 65 seconds | |
stop program = "/bin/bash -c 'export RAILS_ENV=<%= @framework_env %>;cd /data/<%= @app_name %>/current/;script/delayed_job stop -i <%= @worker_count %>'" | |
if totalmem is greater than 240 MB for 2 cycles then restart # eating up memory? | |
group dj_<%= @app_name %> |
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
# Helper : app/helpers/bookings_helper.rb | |
module BookingsHelper | |
def booking_price(booking) | |
"something" | |
end | |
end | |
# Helper spec : spec/helpers/bookings_helper_spec.rb | |
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') |
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
# | |
# # What's the problem | |
# | |
# I wanna test a before filter that render errors in XML and JSON if failing | |
# When testing it from a classic controller it works fine, when testing from | |
# the ApplicationController directly it fails | |
# | |
# | |
# # Some code please... |
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
# | |
# FIXED: Was due to a validates_inclusion_of having :within instead of :in | |
# | |
# Weird issue after upgrading from Rails 2.3.10 to Rails 3.0.3 | |
# The scope doesn't work. It works with a new sample app but | |
# NOT from the upgraded one. | |
# | |
# Models | |
class User < ActiveRecord::Base |