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
$ rails g spree_account_recurring:install /Users/devin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.4/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `preference' for Spree::Recurring(Table doesn't exist):Class (NoMethodError) | |
from /Users/devin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/spree-account-recurring-d9977b380f05/app/models/spree/recurring.rb:7:in `<class:Recurring>' | |
from /Users/devin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/spree-account-recurring-d9977b380f05/app/models/spree/recurring.rb:2:in `<module:Spree>' | |
from /Users/devin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/spree-account-recurring-d9977b380f05/app/models/spree/recurring.rb:1:in `<top (required)>' | |
from /Users/devin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/ |
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
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
html = %(<span class="has-error">#{html_tag}</span>).html_safe | |
form_fields = %w(textarea input select) | |
element = Nokogiri::HTML::DocumentFragment.parse(html_tag).css(['label', form_fields].join(', ')).first | |
if element.node_name.eql?('label') | |
html = %(<span class='has-error'>#{element}</span>).html_safe | |
elsif form_fields.include?(element.node_name) | |
html = %(<span class='has-error'>#{element}<span class='help-block'>#{[instance.error_message].join(', ')}</span></span>).html_safe | |
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
import sublime, sublime_plugin | |
from os.path import dirname, realpath | |
import subprocess | |
class BuildAndClean(sublime_plugin.TextCommand): | |
def run(self, edit): | |
self.view.window().run_command("build") | |
sublime.set_timeout_async(self.clean, 3000) | |
def clean(self): |
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
ArgumentError at /api/v1/products/components_and_accessories | |
============================================================ | |
> When assigning attributes, you must pass a hash as an argument. | |
app/controllers/api/v1/products_controller.rb, line 7 | |
----------------------------------------------------- | |
``` ruby | |
2 before_filter :verify_auth_token |
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 | |
before_filter :collect_http_referrer | |
def collect_http_referrer | |
session[:http_referrer] ||= request.env["HTTP_REFERER"] | |
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
$ rails g active_admin:install | |
invoke devise | |
generate devise:install | |
create config/initializers/devise.rb | |
create config/locales/devise.en.yml | |
=============================================================================== | |
Some setup you must do manually if you haven't yet: |
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
//Jay's additions to Active Admin: | |
$(document).ready(function() { | |
function changeSubcategories(selection) { | |
// entrance_page = $("#title_bar a:eq(2)").text(); | |
data = { 'data': selection } //, 'entrance_page': ent } | |
$.post("/get_subcategories", data); | |
} | |
//changeSubcategories(); | |
$("#entrance_page_source_category_id").change(function() { | |
changeSubcategories($("#entrance_page_source_category_id option:selected").text()); |
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 'capistrano/ext/multistage' | |
require "bundler/capistrano" | |
require "delayed/recipes" | |
require 'capistrano_colors' | |
# multistage ---------------- | |
set :stages, %w(staging production) | |
set :default_stage, "staging" |
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
~/Sites/example$ cap deploy:migrations ✹master ‹ruby-1.9.2@rails31› | |
triggering start callbacks for `deploy:migrations' | |
* 11:44:19 == Currently executing `multistage:ensure' | |
*** Defaulting to `staging' | |
* 11:44:19 == Currently executing `staging' | |
* 11:44:19 == Currently executing `deploy:migrations' | |
* 11:44:19 == Currently executing `deploy:update_code' | |
updating the cached checkout on all servers | |
executing locally: "git ls-remote git@github.com:sandboxindustries/example.git master" | |
command finished in 1119ms |
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 | |
before_filter :fix_accept_header | |
protected | |
def fix_accept_header | |
request.format = :html unless Mime::SET.map(&:symbol).include?(request.format.to_sym) | |
end |
OlderNewer