[Lineitem, GLcode, Request, Product].each do |model|
model.content_columns.each do |column|
in_place_edit_for model.to_s.downcase.to_sym, column.name
in_place_loader_for model.to_s.downcase.to_sym, column.name
end
end
Jamey
Confidentiality Notice: This email message, including any attachments,
is for the sole use of the intended recipient(s) and may contain
confidential and/or privileged information. If you are not the intended
recipient(s), you are hereby notified that any dissemination,
unauthorized review, use, disclosure or distribution of this email and
any materials contained in any attachments is prohibited. If you receive
this message in error, or are not the intended recipient(s), please
immediately notify the sender by email and destroy all copies of the
original message, including attachments.
I didn’t test it, but I’m pretty sure it ought to wok as is. If not,
tweak it a bit.
def self.edit_all_columns(*class_names)
class_names.each do |c|
klass = Kernel.const_get c.to_s.camelize
klass.content_columns.each do |column|
in_place_edit_for c, column.name
in_place_loader_for c, column.name
end
end
end
def self.edit_all_columns(*class_names)
class_names.each do |c|
klass = Kernel.const_get c.to_s.camelize
klass.content_columns.each do |column|
in_place_edit_for c, column.name
in_place_loader_for c, column.name
end
end
end
Pat, your way of doing this worked beautifully. Thanks a lot!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.