⌂
›
Integrations
›
Rails Integration
Rails Integration
Ruflet already has a Rails-first integration package: ruflet_rails.
This is the right choice when you want Ruflet UI inside a Rails app instead of as a separate standalone project.
Add the gem
gem TOKPLACEHOLDER0TOKEN, ">= 0.0.5"Install into a Rails app
-function">bin/rails generate -function">ruflet:installThe generator creates and configures:
app/mobile/main.rbruflet.yaml- Ruflet mount routes in
config/routes.rb - a client template when one is available locally
Generated config
app:
name: My App
ruflet_client_url: TOKPLACEHOLDER0TOKEN
services: []
assets:
splash_screen: assets/splash.png
icon_launcher: assets/icon.pngIn Rails apps, asset paths are resolved from app/assets/ during build.
Build from Rails
The Rails integration exposes a build pipeline that mirrors the CLI:
-function">bundle exec rake -function">ruflet:build[web]
-function">bundle exec rake -function">ruflet:build[macos]
-function">bundle exec rake -function">ruflet:build[windows]
-function">bundle exec rake -function">ruflet:build[linux]
-function">bundle exec rake -function">ruflet:build[apk]
-function">bundle exec rake -function">ruflet:build[android]
-function">bundle exec rake -function">ruflet:build[ios]
-function">bundle exec rake -function">ruflet:build[aab]Minimal Rails-side app
require TOKPLACEHOLDER0TOKEN
Ruflet.run do |page|
page.title = TOKPLACEHOLDER1TOKEN
page.add(text(TOKPLACEHOLDER2TOKEN))
endWhen to choose Rails integration
Use ruflet_rails when:
- your product already lives in Rails
- you want Ruflet screens backed by existing Rails data and routes
- you want to keep deployment and business logic centered in one Rails codebase
Use standalone Ruflet apps when:
- you want a clean app repo
- the UI/runtime lifecycle is independent from a Rails server
- you are packaging a more app-centric experience