How can I maintain a session across Ruby on Rails pages in an embedded app?

How can I maintain a session across Ruby on Rails pages in an embedded app?

lokki54
Shopify Partner
55 0 15

Hello I have successfully create a ruby on rails app based on instructions https://github.com/Shopify/shopify_app

 

Rails v7, shopify_app v22, Ruby 3.2

 

For my app I generate an MVC with db tables to save some data

rails generate scaffold post title:string body:text
 
Then I set the root to the root :to => 'posts#index' which works fine and I see the index page from the posts_controller.rb (include ShopifyApp::EmbeddedApp include ShopifyApp::EnsureInstalled added like in Home controller to maintain Shopify session)
 
However when I go to /posts/new or posts/1 to create new or show existing I see Shopify UI with prompt to login
It seems to me the Shopify gem session is not maintained across the rails pages
myapp.png
What am I missing? How to hold embedded app session through ruby on rails pages (same controller)

 

Replies 3 (3)

lokki54
Shopify Partner
55 0 15

As expected no support here

lokki54
Shopify Partner
55 0 15

Hello. Anyone here to help? 😁

hamptonmakes
Shopify Partner
2 0 1

I'm struggling with this exact issue myself. 😕