Skip to content

Instantly share code, notes, and snippets.

@rurounijones
rurounijones / Committee.rb
Created June 7, 2009 07:35 — forked from be9/acl9_query_by_role.rb
Using method_missing to dynamically create subject listing for objects based on role
class DynamicFinderMatch
attr_accessor :attribute
def initialize(method_sym)
if Role.all(:select => 'name').map{|n| n.name.pluralize}.include?(method_sym.to_s)
@attribute = method_sym
end
end
def match?
@attribute != nil
@rurounijones
rurounijones / exam_group.rb
Created May 14, 2011 15:56 — forked from kracekumar/exam_group.rb
exam_group_error
Exam Columns (0.7ms) SHOW FIELDS FROM `exams`
Subject Load (0.1ms) SELECT * FROM `subjects` WHERE (`subjects`.`id` = 11 AND (`subjects`.`is_deleted` = 0))
ActionView::TemplateError (undefined method `_delete' for #<Exam:0xb6c53be8>) on line #69 of app/views/exam/_exam_marks_form.rhtml:
66: <td class="col-1">
67: <div class="label-field-pair2">
68: <div class="text-input-bg2">
69: <%= exam_form.check_box :_delete %>
70: </div>
71: </div>