Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating rails & angularjs

I tried Angular, and I liked it. I've began to integrate him into my rails-app, but then appeared some doubts about architecture

  1. Routes. I would like to navigate without refreshing the page, before i used Wiselinks gem, it's easy and cool - just install, patch link_to helper and done. But angular have his own router, and ui-router (which is cool). I want my app to be running at the browser like Opera Mini and IE, but ui-router doesn't have such callbacks as in wiselinks. I wouldn't create mobile site version - the design is adaptive yet. It means, I would use rails routing, but I want to AJAX page refreshing when it can be (progressive enchansement, yep). What do I do?

  2. In many places, the content is rendered by Angular, i.e. a list of posts (by ajaxing json). That fast & cool on desktop, but again old browsers! I need to render it on server for them. Or I haven't?

I'm stuck. Thanks.

like image 412
just so Avatar asked Nov 12 '22 23:11

just so


1 Answers

This would be best trip to angularjs + rails 4...

This post clear my doubts and now i m very clear about architecture, routes, controllers, model, etc..

http://www.honeybadger.io/blog/2013/12/11/beginners-guide-to-angular-js-rails

I hope this solves your DOUBTs

and to know further about angularjs visit

http://www.angularjs.org

like image 160
SSR Avatar answered Nov 15 '22 12:11

SSR