Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbo-drive is breaking strada components in a turbo-ios app #28

Closed
obromios opened this issue Jan 15, 2024 · 2 comments
Closed

Turbo-drive is breaking strada components in a turbo-ios app #28

obromios opened this issue Jan 15, 2024 · 2 comments

Comments

@obromios
Copy link

obromios commented Jan 15, 2024

I have ask this question on stackoverflow and not received an answer, so perhaps it is an issue with strada-ios.

Using turbo-ios, I was was able to very quickly convert my web-app to an iOS app in a Rails 7.0.0 app with ruby 3.2.2. I want to use some native menus. So using strada, I converted my top menus to native menus. This mostly works except that successful form submission somehow breaks the nexus between the native components and the bridge controllers so clicking on the native menu icon no longer opens the menu. This despite all the stimulus controllers reconnecting after the successful submission.

I am using Turbo-drive by inserting <%= turbo_include_tags %> in the <head> tag and inserting into the application.js

window.Turbo = Turbo
Turbo.session.drive = true

A typical controller action is

   def create
    @lesson = Lesson.new
    if @lesson = @student.lessons.build(lesson_params)
      flash[:success] = 'Lesson has been posted'
      redirect_to root_path
    else
      @title = 'Post Lesson'
      @user = current_user
      render :new, status: :unprocessable_entity
    end
  end

I am hoping that this is just a matter of missing a configuration step, because if I configure my development server to point to the ip address of my machine everything works fine, i.e. the form submission does not break the native menu.

This server configuration is done by setting

config.asset_host = 'http//123.566.0.123:3000'

and running the server with rails s -b 0.0.0.0 -p 3000, but still keeping the Swift code url pointing to http://localhost:3000.

@obromios
Copy link
Author

I tried Joe Masilotti's PR#24 and it appears to fix this problem.

@joemasilotti
Copy link
Member

Resolved via #24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants