Skip to content

Instantly share code, notes, and snippets.

View tispratik's full-sized avatar

Pratik Khadloya tispratik

View GitHub Profile
Am getting the following error:
Modul(#36555780) expected, got String(#21132310)
After doing a lot of research on the net, i found that i need to pass
on the id field somehow, but i dont really know how to do it.
Following is the model:
---------------------------------
class Modul < ActiveRecord::Base
belongs_to :modulable, :polymorphic => true
# -*- mode: ruby -*-
require 'sinatra'
require 'rubygems'
require 'bundler/setup'
#require 'lib/java'
#require 'rack/handler/glassfish'
set :run, false
set :public, './public'
# Disable automatic framework detection by uncommenting/setting to false
Warbler.framework_detection = false
# Warbler web application assembly configuration file
Warbler::Config.new do |config| config.java_libs += FileList["lib/java/*.jar"]
# Features: additional options controlling how the jar is built.
# Currently the following features are supported:
# - gemjar: package the gem repository in a jar file in WEB-INF/lib
# config.features = %w(gemjar)
@tispratik
tispratik / gist:1019849
Created June 10, 2011 21:50
God Config File
God.log_level = :debug
ENV['RAILS_ENV'] ||= "staging"
ENV['RAILS_ROOT'] ||= ENV['RAILS_ENV'] == "development" ? "." : "/home/rails/public_html/myapp/current"
ENV['GOD_UID'] ||= ENV['RAILS_ENV'] == "development" ? ENV["LOGNAME"] : "rails"
ENV['GOD_GID'] ||= ENV['RAILS_ENV'] == "development" ? "staff" : "rails"
puts "God is starting with:"
puts "RAILS_ENV = #{ENV['RAILS_ENV']}"
puts "RAILS_ROOT = #{ENV['RAILS_ROOT']}"
@tispratik
tispratik / dabblet.css
Created February 6, 2012 08:29 — forked from chriscoyier/dabblet.css
Based on email I got from andrea ricci
/* Based on email I got from andrea ricci */
a[href^="mailto:"]:before { content: "\2709"; }
.phone:before { content: "\2706"; }
.important:before { content: "\27BD"; }
blockquote:before { content: "\275D"; }
blockquote:after { content: "\275E"; }
.alert:before { content: "\26A0"; }
:before, :after {
@tispratik
tispratik / dabblet.css
Created February 6, 2012 08:29 — forked from chriscoyier/dabblet.css
Based on email I got from andrea ricci
/* Based on email I got from andrea ricci */
a[href^="mailto:"]:before { content: "\2709"; }
.phone:before { content: "\2706"; }
.important:before { content: "\27BD"; }
blockquote:before { content: "\275D"; }
blockquote:after { content: "\275E"; }
.alert:before { content: "\26A0"; }
:before, :after {
@tispratik
tispratik / dabblet.css
Created February 6, 2012 08:29 — forked from chriscoyier/dabblet.css
Based on email I got from andrea ricci
/* Based on email I got from andrea ricci */
a[href^="mailto:"]:before { content: "\2709"; }
.phone:before { content: "\2706"; }
.important:before { content: "\27BD"; }
blockquote:before { content: "\275D"; }
blockquote:after { content: "\275E"; }
.alert:before { content: "\26A0"; }
:before, :after {
# This patch is required:
# For: google authentication.
# When: Running rails on a port other than 80 where a proxy server proxies to rails.
# Cause: 1. Rack is not able to figure out that it should not set the realm url port to the rails custom port in case the full_host is mentioned using
# OmniAuth.config.full_host
# 2. OpenID tries to validate the incoming callback url with the custom port that rails is running on and throws the error "return_to #{meth.to_s} does not match".
env = Rails.env
if env != "development"
@tispratik
tispratik / Gemfile
Created June 13, 2012 21:16
Gemfile
source 'http://rubygems.org'
gem 'rails', '~> 3.1.0'
gem 'mongrel', '>=1.2.0.pre2', :group => :development
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
@tispratik
tispratik / Gemfile.lock
Created June 13, 2012 21:17
Gemfile.lock
GIT
remote: git://github.com/marktorrance/awesome_nested_set.git
revision: 79e7f4839f9c47ea4181067a459286964858f74f
specs:
awesome_nested_set (2.1.2)
activerecord (>= 3.0.0)
GIT
remote: git://github.com/mbleigh/ruby-openid.git
revision: 4b6fdd152edbc9d1f617056879eb03bd82b78eb4