Clean Up the code

Man... I am new to ruby / rails myself ... But ... I try to RTFM .. and also... i have actually bought some books... But all the stuff you're asking in this thread is here ...

Rails AntiPatterns: Best Practice Ruby on Rails Refactoring (Addison-Wesley Professional Ruby Series) // http://www.amazon.com/Rails-AntiPatterns-Refactoring-Addison-Wesley-Professional/dp/0321604814/ref=sr_1_fkmr1_1?ie=UTF8&qid=1328515732&sr=8-1-fkmr

Also, before starting books ... i have started the hardway ... wrote a piece of code ... try to make it cleaner ... and start refactoring it ... 'til i'll be satisfied with my work ...

You can't become a guru / specialist if you rely on others to fix your own problems.

I guess that you'd have received a better help if instead of asking "What will be the solution for the above issue?" you'd have at least asking for an opinion : "Guys, i had this code, I have refactored it like this... Is there something else I can improve ?"

Alecslupu

Asking for the answers != getting help to learn. See ESR's essay for more:

http://catb.org/esr/faqs/smart-questions.html

In short, you'll get far more positive responses if you demonstrate that you've actually attempted to solve the problem *before* posting, instead of just copying and pasting.

--Matt Jones