I've grouped a set of controllers in a folder called: "Foursquare", the class declaration with the module name looks like this: Foursquare::BadgesController. Inside this controllers I want to call methods from the Foursquare gem that also has the Foursquare Module:
class Foursquare::BadgesController < ApplicationController
def search
user = Foursquare::User.new(session[:access_token])
end
end
So it doesn't work.
Is there any option bes开发者_StackOverflowides renaming the controller's Module name ?
Why doesn't it work? Nothing says you can't insert your own classes into the Foursquare module space. Not that it's necessarily a good idea, but the language allows it no problem.
精彩评论