Re: [Rails] Best practice to use AngularJS with Rails 4

2014-02-07 Thread Paul
Unfortunately, it's not open source. Sorry.


On Fri, Feb 7, 2014 at 1:30 AM, tamouse pontiki tamouse.li...@gmail.comwrote:

 On Tue, Feb 4, 2014 at 10:50 PM, Paul p...@nines.org wrote:
  Don't know about best practice, but what I did was create a single page
  app, with an appcache manifest. Since the browser URL changes, you still
  have to create a bunch of entries in your routes file, but they all
 point to
  the same controller method. Then all the user data is stored in
 LocalStorage
  on the browser, so it is really fast and doesn't depend on having a
  connection. Then, I have a timer that periodically ajaxes any changes
 back
  up to the server, where it stores them as key/value pairs. When the user
  logs in, the browser requests all the user's data at once and recreates
 the
  LocalStorage. When the user logs out, LocalStorage is deleted. Once I set
  that up, I haven't had to touch a controller or model since: it is all
 js,
  css, erb, and helpers.

 Would you mind showing us? Is this an open source project? I'd love to
 peruse the code...

 
 
 
 
  On Mon, Feb 3, 2014 at 2:20 PM, Arun kant sharma iarunk...@gmail.com
  wrote:
 
  What is best practice to use angular with rails 4. I can think of
  following:
 
  Create an JSON API only rails app and deliver a single page app to
 client
  and angular take care of talking to API.
  Create an normal rails app with API which delivered through
  api.domain.com. Serve single page app and angular talk to api.
 (turbolinks
  can cause problems, but at least browser without json support can view a
  html page rendered by server)
  Same as 2 but instead single page app, each rendered view is treated as
  mini-SPA, I don't think it will be very helpful.
 
  So what is best practice to use angular with rails 4.
 
  I think this post is not particular to angularjs and seek best
 integration
  with client side MV* frameworks(like knockout and others).
 
  I am creating a new application so I can decide early and choose best
  practice early and don't have to undo already made decisions if it was a
  existing application.
 
  Thanks,
 
  Arun
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Ruby on Rails: Talk group.
  To unsubscribe from this group and stop receiving emails from it, send
 an
  email to rubyonrails-talk+unsubscr...@googlegroups.com.
  To post to this group, send email to rubyonrails-talk@googlegroups.com.
  To view this discussion on the web visit
 
 https://groups.google.com/d/msgid/rubyonrails-talk/CAGHQMchtPM20XJVm%2BEC5c99daseQwR4FR6P4VAJuxEdFZqt36A%40mail.gmail.com
 .
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
  --
  You received this message because you are subscribed to the Google Groups
  Ruby on Rails: Talk group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to rubyonrails-talk+unsubscr...@googlegroups.com.
  To post to this group, send email to rubyonrails-talk@googlegroups.com.
  To view this discussion on the web visit
 
 https://groups.google.com/d/msgid/rubyonrails-talk/CABceSpCArN2ApwxQOy_N0UwoYRUXQ3fDUWntA_J4F56TDMNhZQ%40mail.gmail.com
 .
 
  For more options, visit https://groups.google.com/groups/opt_out.

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t-R9g35ek9Vs2uAF%3Dh2cRmd9Pd0zwL6TQXwwNdQ3NpRzw%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CABceSpCnvB3%3DTLO%2Bx2RnUpMnQ%2BPE7VGxGnpjw9vbz8T8BTHxDg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Best practice to use AngularJS with Rails 4

2014-02-07 Thread Carlos Figueiredo
Recently I received an article on my twitter timeline... about testing
angular using his karma framework with sprockets... maybe can help you...

http://sebastien.saunier.me/blog/2014/02/04/angular--rails-with-no-fuss.html
*http://sebastien.saunier.me/blog/2014/02/04/angular--rails-with-no-fuss.htmlhttp://sebastien.saunier.me/blog/2014/02/04/angular--rails-with-no-fuss.htmhttp://sebastien.saunier.me/blog/2014/02/04/angular--rails-with-no-fuss.html
http://sebastien.saunier.me/blog/2014/02/04/angular--rails-with-no-fuss.htmlhttp://sebastien.saunier.me/blog/2014/02/04/angular--rails-with-no-fuss.htmhttp://sebastien.saunier.me/blog/2014/02/04/angular--rails-with-no-fuss.html*


On Fri, Feb 7, 2014 at 4:30 AM, tamouse pontiki tamouse.li...@gmail.comwrote:

 On Tue, Feb 4, 2014 at 10:50 PM, Paul p...@nines.org wrote:
  Don't know about best practice, but what I did was create a single page
  app, with an appcache manifest. Since the browser URL changes, you still
  have to create a bunch of entries in your routes file, but they all
 point to
  the same controller method. Then all the user data is stored in
 LocalStorage
  on the browser, so it is really fast and doesn't depend on having a
  connection. Then, I have a timer that periodically ajaxes any changes
 back
  up to the server, where it stores them as key/value pairs. When the user
  logs in, the browser requests all the user's data at once and recreates
 the
  LocalStorage. When the user logs out, LocalStorage is deleted. Once I set
  that up, I haven't had to touch a controller or model since: it is all
 js,
  css, erb, and helpers.

 Would you mind showing us? Is this an open source project? I'd love to
 peruse the code...

 
 
 
 
  On Mon, Feb 3, 2014 at 2:20 PM, Arun kant sharma iarunk...@gmail.com
  wrote:
 
  What is best practice to use angular with rails 4. I can think of
  following:
 
  Create an JSON API only rails app and deliver a single page app to
 client
  and angular take care of talking to API.
  Create an normal rails app with API which delivered through
  api.domain.com. Serve single page app and angular talk to api.
 (turbolinks
  can cause problems, but at least browser without json support can view a
  html page rendered by server)
  Same as 2 but instead single page app, each rendered view is treated as
  mini-SPA, I don't think it will be very helpful.
 
  So what is best practice to use angular with rails 4.
 
  I think this post is not particular to angularjs and seek best
 integration
  with client side MV* frameworks(like knockout and others).
 
  I am creating a new application so I can decide early and choose best
  practice early and don't have to undo already made decisions if it was a
  existing application.
 
  Thanks,
 
  Arun
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Ruby on Rails: Talk group.
  To unsubscribe from this group and stop receiving emails from it, send
 an
  email to rubyonrails-talk+unsubscr...@googlegroups.com.
  To post to this group, send email to rubyonrails-talk@googlegroups.com.
  To view this discussion on the web visit
 
 https://groups.google.com/d/msgid/rubyonrails-talk/CAGHQMchtPM20XJVm%2BEC5c99daseQwR4FR6P4VAJuxEdFZqt36A%40mail.gmail.com
 .
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
  --
  You received this message because you are subscribed to the Google Groups
  Ruby on Rails: Talk group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to rubyonrails-talk+unsubscr...@googlegroups.com.
  To post to this group, send email to rubyonrails-talk@googlegroups.com.
  To view this discussion on the web visit
 
 https://groups.google.com/d/msgid/rubyonrails-talk/CABceSpCArN2ApwxQOy_N0UwoYRUXQ3fDUWntA_J4F56TDMNhZQ%40mail.gmail.com
 .
 
  For more options, visit https://groups.google.com/groups/opt_out.

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t-R9g35ek9Vs2uAF%3Dh2cRmd9Pd0zwL6TQXwwNdQ3NpRzw%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CANPOtXtAaeZpLWkSeC3Mv-yChXkHu%3DkUo-_q5bs%3DWyxEYC-6ug%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Best practice to use AngularJS with Rails 4

2014-02-06 Thread tamouse pontiki
On Tue, Feb 4, 2014 at 10:50 PM, Paul p...@nines.org wrote:
 Don't know about best practice, but what I did was create a single page
 app, with an appcache manifest. Since the browser URL changes, you still
 have to create a bunch of entries in your routes file, but they all point to
 the same controller method. Then all the user data is stored in LocalStorage
 on the browser, so it is really fast and doesn't depend on having a
 connection. Then, I have a timer that periodically ajaxes any changes back
 up to the server, where it stores them as key/value pairs. When the user
 logs in, the browser requests all the user's data at once and recreates the
 LocalStorage. When the user logs out, LocalStorage is deleted. Once I set
 that up, I haven't had to touch a controller or model since: it is all js,
 css, erb, and helpers.

Would you mind showing us? Is this an open source project? I'd love to
peruse the code...





 On Mon, Feb 3, 2014 at 2:20 PM, Arun kant sharma iarunk...@gmail.com
 wrote:

 What is best practice to use angular with rails 4. I can think of
 following:

 Create an JSON API only rails app and deliver a single page app to client
 and angular take care of talking to API.
 Create an normal rails app with API which delivered through
 api.domain.com. Serve single page app and angular talk to api. (turbolinks
 can cause problems, but at least browser without json support can view a
 html page rendered by server)
 Same as 2 but instead single page app, each rendered view is treated as
 mini-SPA, I don't think it will be very helpful.

 So what is best practice to use angular with rails 4.

 I think this post is not particular to angularjs and seek best integration
 with client side MV* frameworks(like knockout and others).

 I am creating a new application so I can decide early and choose best
 practice early and don't have to undo already made decisions if it was a
 existing application.

 Thanks,

 Arun

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CAGHQMchtPM20XJVm%2BEC5c99daseQwR4FR6P4VAJuxEdFZqt36A%40mail.gmail.com.
 For more options, visit https://groups.google.com/groups/opt_out.


 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CABceSpCArN2ApwxQOy_N0UwoYRUXQ3fDUWntA_J4F56TDMNhZQ%40mail.gmail.com.

 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t-R9g35ek9Vs2uAF%3Dh2cRmd9Pd0zwL6TQXwwNdQ3NpRzw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Best practice to use AngularJS with Rails 4

2014-02-04 Thread tamouse pontiki
On Mon, Feb 3, 2014 at 1:20 PM, Arun kant sharma iarunk...@gmail.com wrote:
 What is best practice to use angular with rails 4. I can think of following:

 Create an JSON API only rails app and deliver a single page app to client
 and angular take care of talking to API.
 Create an normal rails app with API which delivered through api.domain.com.
 Serve single page app and angular talk to api. (turbolinks can cause
 problems, but at least browser without json support can view a html page
 rendered by server)
 Same as 2 but instead single page app, each rendered view is treated as
 mini-SPA, I don't think it will be very helpful.

 So what is best practice to use angular with rails 4.

 I think this post is not particular to angularjs and seek best integration
 with client side MV* frameworks(like knockout and others).

 I am creating a new application so I can decide early and choose best
 practice early and don't have to undo already made decisions if it was a
 existing application.

I haven't delved into AngularJS yet, but there have been a spate of
articles out on using Angular with Rails, many of them with Best
Practices in the title. My collection is in disarray at the moment,
but I am sure a google of Rails and AngularJS Best Practices turns
up a lot of hits.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t8Tjk0kEcTtw9b9n4ta9K5xU5inX%2BNLoV7o4sS6UyUwyg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Best practice to use AngularJS with Rails 4

2014-02-04 Thread Paul
Don't know about best practice, but what I did was create a single page
app, with an appcache manifest. Since the browser URL changes, you still
have to create a bunch of entries in your routes file, but they all point
to the same controller method. Then all the user data is stored in
LocalStorage on the browser, so it is really fast and doesn't depend on
having a connection. Then, I have a timer that periodically ajaxes any
changes back up to the server, where it stores them as key/value pairs.
When the user logs in, the browser requests all the user's data at once and
recreates the LocalStorage. When the user logs out, LocalStorage is
deleted. Once I set that up, I haven't had to touch a controller or model
since: it is all js, css, erb, and helpers.




On Mon, Feb 3, 2014 at 2:20 PM, Arun kant sharma iarunk...@gmail.comwrote:

 What is best practice to use angular with rails 4. I can think of
 following:


1. Create an JSON API only rails app and deliver a single page app to
client and angular take care of talking to API.
2. Create an normal rails app with API which delivered through
api.domain.com. Serve single page app and angular talk to api.
(turbolinks can cause problems, but at least browser without json support
can view a html page rendered by server)
3. Same as 2 but instead single page app, each rendered view is
treated as mini-SPA, I don't think it will be very helpful.

 So what is best practice to use angular with rails 4.

 I think this post is not particular to angularjs and seek best integration
 with client side MV* frameworks(like knockout and others).

 I am creating a new application so I can decide early and choose best
 practice early and don't have to undo already made decisions if it was a
 existing application.

 Thanks,

 Arun

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CAGHQMchtPM20XJVm%2BEC5c99daseQwR4FR6P4VAJuxEdFZqt36A%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CABceSpCArN2ApwxQOy_N0UwoYRUXQ3fDUWntA_J4F56TDMNhZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.