Created
May 17, 2012 09:28
-
-
Save kalleth/2717725 to your computer and use it in GitHub Desktop.
Controllers for GreekFreak
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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