JQuery ui accordion not working in ajax call in ruby on rails

I am using RubyGem jquery ui 5.0.x version and rails 4.0.x. I am trying to use accordion in success call back of ajax when I face the error "Accordion is not a function". but accordion is working fine with static content. I face problems only on ajax success callback

Can anyone please help me?

Attachments: http://www.ruby-forum.com/attachment/10279/code.txt