I have a Ruby on Rails application that, at it's most basic level consists of two panels, the left and the right side panel. What I want is to use this as a layout, and in the controllers to be able to render like render <view_name>, <right or left panel>
, so that, in combination with turbolinks, only the left or right side panels are being created dynamically.
I searched the internet but didn't find any examples like mine. I'm sure this is doable but how?
EDIT:it should be able to run in chrome for Android.
One solution would be to render all the views on the first request, and when I click a link panels are hidden and shown, but I don't think this is Ok. Any opinions?
Well after some research I reached the following conclusion:
With I was trying to do is not possible unless you set some limitations.
Only one of the two panels can render "actions" that are stored in the browsing history. If both panels render actions that are stored in the browsing history it's highly probable that navigation won't work as expected.
With this in mind I realized that what I actually need is to render the navigation aware actions in the left panel, and in the right panel render the other stuff(I call them utilities). For example one thing that I render in such a panel is a Chat-Panel.This is how facebook works with it's chat.
So basically I can user standard turbolinks to handle the requests which store browsing history and something like pjax for the "Utils" panel. The only problem is the Turbolinks completely renders the whole page, even if you send a small piece of html as a response.
To solve this I ended up using wiselinks, which is the perfect combination of turbolinks and pjax. Also, unlike pjax, wiselinks can even handle forms.