So here's a weird one:
I'm using the ui.router with Restangular in AngularJS, and when I want to get a specific resource I can do:
Restangular.one('books', $stateParams.id)
and then in rails:
@book = Book.find( params[:id] )
and that works.
'
But if I use:
@book = Book.where(id: params[:id])
that doesn't work.
this has something to do with params in rails and $stateParams, and how AngularJS is talking to rails, but I'm not sure what's really going on. I want to be able to say:
@pages = Page.where(book_id: params[:id])
so I can access the pages of book 2 or whatever.
Book.where(id: params[:id]).first
– apneadiving Jul 15 '14 at 6:15