Skip to content

Instantly share code, notes, and snippets.

View workmad3's full-sized avatar

David Workman workmad3

View GitHub Profile
require 'myclass'
traceable = MyClass.CreateTraceableObject()
Last login: Wed Mar 24 16:26:40 on ttys001
You have mail.
davidw:~ davidworkman$ cd git/iDoc/
davidw:iDoc davidworkman$ rake -T
(in /Users/davidworkman/git/iDoc)
Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
davidw:iDoc davidworkman$ rails -v
Rails 2.3.5
begin
a.call_method
rescue NoMethodError
""
end
class File
def self.basename_without_ext(filename)
File.basename(filename, ".*")
end
end
class Parent < ActiveRecord::Base
has_many :children do
def my_scope
proxy_owner.children.scoped(proxy_owner)
end
end
end
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
%ul
- @some_arr.each do |item|
%li= item.to_s
class AdminController < ActionController::Base
def index
if can? :access, AdminController
//...
else
unauthorized!
end
end
end
def get_dependency(depend_string)
if depend_string =~ /@depends (.+)/
return $1
end
return ""
end
<% @teachers_not_in_school.each do |t| %>
<% school.fields_for t do |builder| %>
<tr>
<td><%= builder.check_box :id, t.id %></td>
<td><%= t.first_name + ' ' + t.last_name %></td>
</tr>
<% end -%>
<% end -%>