Archive › Ruby On Rails

authlogic-oauth params nil class error

Facing another bug while integration my rails project with twitter using authlogic-oauth and was facing a problem while running my cucumber test. In my step definition file, I was trying to create a simple User object and the error I was getting was as follow: undefined method `params’ for nil:NilClass (NoMethodError) Upon further investigation. The [...]

Comments ( 0 )

Authlogic OAuth Twitter

I was trying to run an Authlogic OAuth Twitter example application on my local development machine and kept getting OAuth::Unauthorized (401 Unauthorized) error. Turns out, you have to register your app as a Twitter OAuth client at http://twitter.com/oauth_clients/. If you’re registering your application as web browser, don’t forget to fill in the callback url. When [...]

Comments ( 0 )

Deploying facebooker app on sub URI

Recently, I had created a rails app which allows people to login with their Facebook account. Thanks to a few existing gems and plugins, the facebook connect integration was straight forward enough. A few gotchas but easily fixed. However what had got me stump for a few hours was deploying my rails app on a [...]

Comments ( 0 )

subdomain name and DNS.

My colleague and I were working on a feature to apply dynamic subdomain name in one of our rails apps. Since a lot of documentation out there only focus on how to host subdomain app by configuring the /etc/hosts file. I reckon I share some insight on how to actually enable dynamic subdomain in your [...]

Comments ( 0 )

Ruby Version Manager

I’ve been meaning to start using ruby1.9 but always stuck at maintaining codes in production that depends on Ruby1.8.6. Fortunately, there’s this thing called Ruby Version Manager where you easily change between different rails version. I have nothing but praise for the guys who made life easier for us programmers to do our job better [...]

Comments ( 0 )

Authlogic is Awesome

Have been tinkering around with authlogic. The most I love about is its out-of-the-box functionality. I used to wrestle with restful_authentication to get certain things that I need. Not in anyway that I’m bashing it but seeing how easy authlogic I couldn’t believe why I didn’t use it sooner. I like it so much that [...]

Comments ( 0 )

My little contribution to a rails plugin (sort of)

Getting your bug fix/code pulled into the main repo really gets you excited & satisfied. I never thought it could give me this much sense of enjoyment. Check it out. http://github.com/dmix/weekly_builder/tree/master

Comments ( 4 )

Includes & Eager Loading

I’m figuring out something in my rails app.  I’m figuring out which one’s the worst: Eager loading 100 rows of data you don’t actually need at the moment or 10 queries giving 10 result set at once? Here’s the code to explain it. 1 2 3 @event = Event.find(params[:event_id])   @event_attendees = @event.attendees.paginate(:page => params[:page], [...]

Comments ( 0 )

Routes Gotcha

Something peculiar happened when I was doing something trivial. If you accidently named your restful route the following resource :roles instead of resources :roles When you point your app to /roles it won’t go to your index controller action but it will instead call your show action.

Comments ( 1 )

Rebuilding Ferret Index

I had trouble reindexing the ferret index using the rake command (rake ferret:rebuild). I got this non-descriptive error regarding failing to rebuild it (Even in my development mode). So after googling for it, all one has to do is so simple. Go into your rails script/console and just type Model.rebuild_index And you’re done.

Comments ( 0 )