Skip to content

Instantly share code, notes, and snippets.

rand_id = rand(Product.count)
rand_record = Product.first(:conditions => [ "id >= ?", rand_id])
class ApplicationController < ActionController::Base
include InheritedResources::DSL
protect_from_forgery
before_filter :categories_for_menu
private
def categories_for_menu
@root_category, @menu_categories = Category.arrange.first
require 'spec_helper'
describe ApplicationController do
controller(ApplicationController) do
def index
render :nothing => true
end
end
it "loads categories for side menu" do
# /usr/local/nginx/conf/rails-vhosts/kdcuk.co.uk.conf
server {
listen 212.110.170.198:80;
server_name kdcuk.co.uk;
root /home/kdcuk/domains/kdcuk.co.uk/current/public; # <--- be sure to point to 'public'!
passenger_enabled on;
rack_env production;
}
@iosadchiy
iosadchiy / a1_test.go
Last active June 21, 2018 08:57
TV A1
package tv_a1
import (
"fmt"
"testing"
)
type Vcpu struct {
}