User Tools

Site Tools


ruby

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ruby [2026/03/15 19:37] – Using Turbo Frames reddyruby [2026/04/19 20:59] (current) reddy
Line 5: Line 5:
 Popular Gems Popular Gems
  
 +  * [[EventMachine]]
   * [[Kaminari]]   * [[Kaminari]]
   * [[Ransack]]   * [[Ransack]]
Line 94: Line 95:
 </code> </code>
  
 +==== Turbo Streams ====
  
 +<code>
 +# In the view
 +<%= turbo_stream_from "src_1" %>
 +<div id="divvy_1"></div>
 +
 +# In a controller
 +Turbo::StreamsChannel.broadcast_update_to(
 +  'src_1',
 +  target: 'divvy_1',
 +  content: DateTime.now  # html: render ...
 +)
 +</code>
 +
 +==== Action Text ====
 +
 +<code>
 +rails action_text:install
 +rails db:migrate
 +
 +# In the model
 +class Post < ApplicationRecord
 +  has_rich_text :body
 +end
 +
 +# In the form
 +<%= form.rich_textarea :body %>
 +</code>
  
ruby.1773599836.txt.gz · Last modified: by reddy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki