开发者

Rails, How to integrate this module

I'm working to add the FB Registration Plugin to my app. The way it works is the plugin posts one param, params["signed_request"] which then needs to be decoded by my app.

I found this tutorial: http://veerasundaravel.wordpress.com/2011/01/27/facebook-registration-plugin-in-rails/

My question is where wo开发者_JAVA技巧uld that module live? And I would I access it in the controller's def create method that recieves params["signed_request"] ?

Thanks


Create one ruby file inside the lib folder and put that module code inside that file. Next you have to autoload the module for that add the below line in config/application.rb

config.autoload_paths += %W(#{config.root}/lib)

restart the server. Now you can access that module inside controller.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜