Skip to content

Instantly share code, notes, and snippets.

@umdstu
Created June 3, 2014 13:40
Show Gist options
  • Save umdstu/427c1be7973735cdd41d to your computer and use it in GitHub Desktop.
Save umdstu/427c1be7973735cdd41d to your computer and use it in GitHub Desktop.
require 'open3'
module ApplicationHelper
def link_to_presenter(item, options = {})
label = options[:label]
url = content_link(item,options)
link_to label, url
end
def content_link(item,options)
...
end
end
class Result < RescursiveOpenStruct
include ApplicationHelper
include EventHelper
def self.clean_up(reports, columns)
cleaned_reports = []
reports.each do |report|
next unless report
map = report.field_map
map.view = link_to_presenter(map, :field => :presenter_id)
..
..
cleaned_reports << map
end
end
NoMethodError (undefined method `link_to_presenter' for Result:Class):
app/models/result.rb:11:in `block in clean_up'
app/models/result.rb:7:in `each'
app/models/result.rb:7:in `clean_up'
app/controllers/reports_controller.rb:200:in `query'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment