<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/generative-ui-in-rails-with-rubyllm-axfknuknv" -->

---
title: Generative UI in Rails with RubyLLM | daily.dev
description: A walkthrough of building generative UI in a Rails chat application using RubyLLM, where the LLM selects and composes UI components rather than generating HTML...
canonical: https://daily.dev/posts/generative-ui-in-rails-with-rubyllm-axfknuknv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Generative UI in Rails with RubyLLM | daily.dev
og:description: A walkthrough of building generative UI in a Rails chat application using RubyLLM, where the LLM selects and composes UI components rather than generating HTML...
og:url: https://daily.dev/posts/generative-ui-in-rails-with-rubyllm-axfknuknv
og:image: https://api.daily.dev/og/posts/AXFkNukNV.png
og:image:alt: Generative UI in Rails with RubyLLM
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Generative UI in Rails with RubyLLM

**[Ruby Flow](https://daily.dev/sources/rubyflow)** · 14 min read · 1 upvotes · 0 comments

## Summary

A walkthrough of building generative UI in a Rails chat application using RubyLLM, where the LLM selects and composes UI components rather than generating HTML directly. Covers three approaches: rendering tool results as UI, per-component tools as render signals, and a single general-purpose `generate_ui` tool that accepts a full component tree. Introduces the GenerativeUI gem, which defines a catalog DSL to derive LLM descriptions, JSON Schema, tree validation, and render targets from a single source of truth. Includes code examples for catalog definition, tool setup, Rails partials for leaf and container components, and handling edge cases like models adding redundant prose after UI tool calls.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://msg.samsonov.io/2026-05-21-generative-ui-ruby-llm>

## Similar posts on daily.dev

- [How generative UI cut our development time from months to weeks](https://daily.dev/posts/how-generative-ui-cut-our-development-time-from-months-to-weeks-operjcgk9) · InfoWorld · 1 upvotes · 0 comments

---

Tags: [#ruby](https://daily.dev/tags/ruby), [#rails](https://daily.dev/tags/rails)

[View this post on daily.dev](https://daily.dev/posts/generative-ui-in-rails-with-rubyllm-axfknuknv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Generative UI in Rails with RubyLLM","url":"https://daily.dev/posts/generative-ui-in-rails-with-rubyllm-axfknuknv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/generative-ui-in-rails-with-rubyllm-axfknuknv"},"datePublished":"2026-05-21T22:12:40.155Z","dateModified":"2026-05-21T22:13:05.744Z","description":"A walkthrough of building generative UI in a Rails chat application using RubyLLM, where the LLM selects and composes UI components rather than generating HTML...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e0bf546d935a34fff57df649015ad786?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e0bf546d935a34fff57df649015ad786?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Ruby Flow","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Ruby Flow","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/a21aaa8bcbbf448193a016895c90a0e1","url":"https://daily.dev/sources/rubyflow"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/generative-ui-in-rails-with-rubyllm-axfknuknv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ruby,rails","timeRequired":"PT14M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Ruby Flow","item":"https://daily.dev/sources/rubyflow"},{"@type":"ListItem","position":3,"name":"Generative UI in Rails with RubyLLM"}]}
```

