Skip to content

Instantly share code, notes, and snippets.

@kalleth
Created May 17, 2012 09:28
Show Gist options
  • Save kalleth/2717725 to your computer and use it in GitHub Desktop.
Save kalleth/2717725 to your computer and use it in GitHub Desktop.
Controllers for GreekFreak
class ApplicationController
private
def my_filter_method(myarg, data)
if myarg == "file"
@file = File.open(myarg, data)
elsif myarg == "url"
Net::HTTP.get(myarg, data)
end
end
end
class PeopleController < ApplicationController
before_filter :obtain_data
private
def obtain_data
my_filter_method("file", "/home/kalleth/people.txt")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment