I’ve done a bit more research on this.
Here is the stackoverflow questions where action_pusher came out of
Here is another gem that attempts render jbuilder views from a model
I haven’t given it too much time, but I wasn’t able to get much done with action_pusher. I’m not sure if it was a rails 4 issue or not, but the render calls were just returning nil
This seemed promising, but it immediately crashed because I’m rending jbuilder partials inside of partials, and it didn’t seem to be able to handle this.
I’ve basically decided I have 3 options.
Rip out jbuilder and switch to active model serializers. It seem to be able to handle the concept of scope and passing in current user. I’ve never used active model serializers before so I’m not sure it would actual do what I want.
Use jbuilder hybrid approach that involves using jbuilder views for some of the app and to_builder for any object I need to send to pusher. This would move a lot of my json display code into models or ruby objects. I’ve played around with this a little bit, and it’s pretty painful. Jbuilder views don’t seem to play all that nice with to_builder. Also, I am going to have to pass through a current_user variable down into the model through multiple associated objects to render what I want.
Build a simplified version of action_pusher which renders the jbuilder views through an ugly use of Rails view and controller objects in my models. I’ve already have found trouble passing through the context of current_user through more than one layer of partials. This approach along with action_pusher just seems dirty.
I’m going to sleep on it and then hopefully make a decision. I’m not excited about any of my current options so feel free to leave any thoughts.