repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/guides/rails_guides/markdown.rb | guides/rails_guides/markdown.rb | # frozen_string_literal: true
require "redcarpet"
require "nokogiri"
require "rails_guides/markdown/renderer"
require "rails_guides/markdown/epub_renderer"
module RailsGuides
class Markdown
def initialize(view:, layout:, edge:, version:, epub:)
@view = view
@layout = layout
@ed... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/guides/rails_guides/generator.rb | guides/rails_guides/generator.rb | # frozen_string_literal: true
require "fileutils"
require "nokogiri"
require "securerandom"
require "digest"
require "active_support/core_ext/string/output_safety"
require "active_support/core_ext/object/blank"
require "action_controller"
require "action_view"
require "rails_guides/markdown"
require "rails_guides/he... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/guides/rails_guides/markdown/renderer.rb | guides/rails_guides/markdown/renderer.rb | # frozen_string_literal: true
require "rouge"
# Add more common shell commands
Rouge::Lexers::Shell::BUILTINS << "|bin/rails|brew|bundle|gem|git|node|rails|rake|ruby|sqlite3|yarn"
# Register an IRB lexer for Rails 7.2+ console prompts like "store(dev)>"
class Rouge::Lexers::GuidesIRBLexer < Rouge::Lexers::IRBLexer
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/guides/rails_guides/markdown/epub_renderer.rb | guides/rails_guides/markdown/epub_renderer.rb | # frozen_string_literal: true
require "rouge"
# Add more common shell commands
Rouge::Lexers::Shell::BUILTINS << "|bin/rails|brew|bundle|gem|git|node|rails|rake|ruby|sqlite3|yarn"
module RailsGuides
class Markdown
class EpubRenderer < Redcarpet::Render::XHTML # :nodoc:
cattr_accessor :edge, :version
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/app/helpers/action_text/content_helper.rb | actiontext/app/helpers/action_text/content_helper.rb | # frozen_string_literal: true
# :markup: markdown
require "rails-html-sanitizer"
module ActionText
module ContentHelper
mattr_accessor(:sanitizer, default: Rails::HTML4::Sanitizer.safe_list_sanitizer.new)
mattr_accessor(:allowed_tags)
mattr_accessor(:allowed_attributes)
mattr_accessor(:scrubber)
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/app/helpers/action_text/tag_helper.rb | actiontext/app/helpers/action_text/tag_helper.rb | # frozen_string_literal: true
# :markup: markdown
require "active_support/core_ext/object/try"
require "action_view/helpers/tags/placeholderable"
module ActionText
module TagHelper
# Returns a `trix-editor` tag that instantiates the Trix JavaScript editor as
# well as a hidden field that Trix will write to... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/app/models/action_text/record.rb | actiontext/app/models/action_text/record.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
class Record < ActiveRecord::Base # :nodoc:
self.abstract_class = true
end
end
ActiveSupport.run_load_hooks :action_text_record, ActionText::Record
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/app/models/action_text/rich_text.rb | actiontext/app/models/action_text/rich_text.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
# # Action Text RichText
#
# The RichText record holds the content produced by the Trix editor in a
# serialized `body` attribute. It also holds all the references to the embedded
# files, which are stored using Active Storage. This record ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/app/models/action_text/encrypted_rich_text.rb | actiontext/app/models/action_text/encrypted_rich_text.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
class EncryptedRichText < RichText
encrypts :body
end
end
ActiveSupport.run_load_hooks :action_text_encrypted_rich_text, ActionText::EncryptedRichText
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/db/migrate/20180528164100_create_action_text_tables.rb | actiontext/db/migrate/20180528164100_create_action_text_tables.rb | class CreateActionTextTables < ActiveRecord::Migration[6.0]
def change
# Use Active Record's configured type for primary and foreign keys
primary_key_type, foreign_key_type = primary_and_foreign_key_types
create_table :action_text_rich_texts, id: primary_key_type do |t|
t.string :name, null: fa... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/application_system_test_case.rb | actiontext/test/application_system_test_case.rb | # frozen_string_literal: true
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :headless_chrome
end
Capybara.server = :puma, { Silent: true }
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/test_helper.rb | actiontext/test/test_helper.rb | # frozen_string_literal: true
require_relative "../../tools/strict_warnings"
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require_relative "../test/dummy/config/environment"
require "active_record/testing/query_assertions"
ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../test/dummy/db/migr... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/javascript_package_test.rb | actiontext/test/javascript_package_test.rb | # frozen_string_literal: true
require "test_helper"
class JavascriptPackageTest < ActiveSupport::TestCase
def test_compiled_code_is_in_sync_with_source_code
compiled_files = %w[
app/assets/javascripts/actiontext.js
app/assets/javascripts/actiontext.esm.js
].map do |file|
Pathname(file).exp... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/system/system_test_helper_test.rb | actiontext/test/system/system_test_helper_test.rb | # frozen_string_literal: true
require "application_system_test_case"
class ActionText::SystemTestHelperTest < ApplicationSystemTestCase
def setup
visit new_message_url
end
test "filling in a rich-text area by ID" do
assert_selector :element, "trix-editor", id: "message_content"
fill_in_rich_textare... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/system/rich_text_editor_test.rb | actiontext/test/system/rich_text_editor_test.rb | # frozen_string_literal: true
require "application_system_test_case"
class ActionText::RichTextEditorTest < ApplicationSystemTestCase
test "attaches and uploads image file" do
image_file = file_fixture("racecar.jpg")
visit new_message_url
attach_file image_file do
click_button "Attach Files"
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/system/trix_editor_test.rb | actiontext/test/system/trix_editor_test.rb | # frozen_string_literal: true
require "application_system_test_case"
require "active_support/core_ext/object/with"
class TrixEditorTest < ApplicationSystemTestCase
test "uploads, attaches, and edits image file" do
image_file = file_fixture("racecar.jpg")
with_editor :trix do
visit new_message_url
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/integration/job_render_test.rb | actiontext/test/integration/job_render_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::JobRenderTest < ActiveJob::TestCase
include Rails::Dom::Testing::Assertions::SelectorAssertions
test "uses app default_url_options" do
blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg")
message = Message.creat... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/integration/mailer_render_test.rb | actiontext/test/integration/mailer_render_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::MailerRenderTest < ActionMailer::TestCase
test "uses default_url_options" do
original_default_url_options = ActionMailer::Base.default_url_options
ActionMailer::Base.default_url_options = { host: "hoost" }
blob = create_file_blob(fil... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/integration/controller_render_test.rb | actiontext/test/integration/controller_render_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::ControllerRenderTest < ActionDispatch::IntegrationTest
test "uses current request environment" do
blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg")
message = Message.create!(content: ActionText::Content.new.appe... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/models/table_name_test.rb | actiontext/test/models/table_name_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::TableNameTest < ActiveSupport::TestCase
setup do
@old_prefix = ActiveRecord::Base.table_name_prefix
@old_suffix = ActiveRecord::Base.table_name_suffix
ActiveRecord::Base.table_name_prefix = @prefix = "abc_"
ActiveRecord::Base.tab... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/jobs/broadcast_job.rb | actiontext/test/dummy/app/jobs/broadcast_job.rb | class BroadcastJob < ApplicationJob
def perform(file, message)
File.write(file, <<~HTML)
<turbo-stream action="replace" target="message_#{message.id}">
<template>#{message.content}</template>
</turbo-stream>
HTML
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/jobs/application_job.rb | actiontext/test/dummy/app/jobs/application_job.rb | class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/helpers/messages_helper.rb | actiontext/test/dummy/app/helpers/messages_helper.rb | module MessagesHelper
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/helpers/application_helper.rb | actiontext/test/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/controllers/messages_controller.rb | actiontext/test/dummy/app/controllers/messages_controller.rb | class MessagesController < ActionController::Base
before_action :set_message, only: [:show, :edit, :update, :destroy]
# This class intentionally does not extend ApplicationController, so the
# layout must be set manually. See commit 614e813 for details
layout "application"
# GET /messages
def index
@m... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/controllers/admin/messages_controller.rb | actiontext/test/dummy/app/controllers/admin/messages_controller.rb | class Admin::MessagesController < ActionController::Base
def show
@message = Message.find(params[:id])
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/models/review.rb | actiontext/test/dummy/app/models/review.rb | class Review < ApplicationRecord
belongs_to :message
has_rich_text :content
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/models/message_without_blanks.rb | actiontext/test/dummy/app/models/message_without_blanks.rb | class MessageWithoutBlanks < ApplicationRecord
self.table_name = Message.table_name
has_rich_text :content, store_if_blank: false
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/models/page.rb | actiontext/test/dummy/app/models/page.rb | class Page < ApplicationRecord
include ActionText::Attachable
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/models/encrypted_message.rb | actiontext/test/dummy/app/models/encrypted_message.rb | class EncryptedMessage < Message
has_rich_text :content, encrypted: true
end | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/models/message.rb | actiontext/test/dummy/app/models/message.rb | class Message < ApplicationRecord
has_rich_text :content
has_rich_text :body
has_one :review
accepts_nested_attributes_for :review
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/models/application_record.rb | actiontext/test/dummy/app/models/application_record.rb | class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/models/message_without_blanks_with_content_validation.rb | actiontext/test/dummy/app/models/message_without_blanks_with_content_validation.rb | class MessageWithoutBlanksWithContentValidation < MessageWithoutBlanks
validates :content, presence: true
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/models/person.rb | actiontext/test/dummy/app/models/person.rb | class Person < ApplicationRecord
include ActionText::Attachable
def self.to_missing_attachable_partial_path
"people/missing_attachable"
end
def to_trix_content_attachment_partial_path
to_editor_content_attachment_partial_path
end
def to_editor_content_attachment_partial_path
"people/trix_cont... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/mailers/messages_mailer.rb | actiontext/test/dummy/app/mailers/messages_mailer.rb | class MessagesMailer < ApplicationMailer
def notification
@message = params[:message]
mail to: params[:recipient], subject: "NEW MESSAGE: #{@message.subject}"
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/mailers/application_mailer.rb | actiontext/test/dummy/app/mailers/application_mailer.rb | class ApplicationMailer < ActionMailer::Base
default from: "from@example.com"
layout "mailer"
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/channels/application_cable/channel.rb | actiontext/test/dummy/app/channels/application_cable/channel.rb | module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/app/channels/application_cable/connection.rb | actiontext/test/dummy/app/channels/application_cable/connection.rb | module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/db/schema.rb | actiontext/test/dummy/db/schema.rb | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/db/migrate/20180528164100_create_action_text_tables.rb | actiontext/test/dummy/db/migrate/20180528164100_create_action_text_tables.rb | class CreateActionTextTables < ActiveRecord::Migration[6.0]
def change
create_table :action_text_rich_texts do |t|
t.string :name, null: false
t.text :body, size: :long
t.references :record, null: false, polymorphic: true, index: false
t.timestamps
t.index [ :record_type,... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/db/migrate/20190305172303_create_pages.rb | actiontext/test/dummy/db/migrate/20190305172303_create_pages.rb | class CreatePages < ActiveRecord::Migration[6.0]
def change
create_table :pages do |t|
t.string :title
t.timestamps
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/db/migrate/20181003185713_create_people.rb | actiontext/test/dummy/db/migrate/20181003185713_create_people.rb | class CreatePeople < ActiveRecord::Migration[6.0]
def change
create_table :people do |t|
t.string :name
t.timestamps
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/db/migrate/20190317200724_create_reviews.rb | actiontext/test/dummy/db/migrate/20190317200724_create_reviews.rb | class CreateReviews < ActiveRecord::Migration[6.0]
def change
create_table :reviews do |t|
t.belongs_to :message, null: false
t.string :author_name, null: false
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/db/migrate/20180208205311_create_messages.rb | actiontext/test/dummy/db/migrate/20180208205311_create_messages.rb | class CreateMessages < ActiveRecord::Migration[6.0]
def change
create_table :messages do |t|
t.string :subject
t.timestamps
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/db/migrate/20180212164506_create_active_storage_tables.rb | actiontext/test/dummy/db/migrate/20180212164506_create_active_storage_tables.rb | # This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
create_table :active_storage_blobs do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
t.... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/application.rb | actiontext/test/dummy/config/application.rb | require_relative "boot"
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Dummy
class Application < Rails::Application
config.load_defaults Rails::VERSION::STRING.to_f
# For compatibil... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/environment.rb | actiontext/test/dummy/config/environment.rb | # Load the Rails application.
require_relative "application"
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/puma.rb | actiontext/test/dummy/config/puma.rb | # This configuration file will be evaluated by Puma. The top-level methods that
# are invoked here are part of Puma's configuration DSL. For more information
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
# Puma can serve each request in a thread from an internal thread pool.
# The `threa... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/routes.rb | actiontext/test/dummy/config/routes.rb | Rails.application.routes.draw do
resources :messages
namespace :admin do
resources :messages, only: [:show]
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/importmap.rb | actiontext/test/dummy/config/importmap.rb | # Pin npm packages by running ./bin/importmap
pin "application", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "trix"
pin "@rails/actiontext", to: "actiontext.esm.js"
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/boot.rb | actiontext/test/dummy/config/boot.rb | # Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../../Gemfile", __dir__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/initializers/content_security_policy.rb | actiontext/test/dummy/config/initializers/content_security_policy.rb | # Be sure to restart your server when you modify this file.
# Define an application-wide content security policy.
# See the Securing Rails Applications Guide for more information:
# https://guides.rubyonrails.org/security.html#content-security-policy-header
# Rails.application.configure do
# config.content_security... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/initializers/filter_parameter_logging.rb | actiontext/test/dummy/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
# notations and behaviors.
Rails.application.config.filter_parameters += [
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/initializers/inflections.rb | actiontext/test/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/initializers/assets.rb | actiontext/test/dummy/config/initializers/assets.rb | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = "1.0"
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/environments/test.rb | actiontext/test/dummy/config/environments/test.rb | require "active_support/core_ext/integer/time"
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data the... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/environments/development.rb | actiontext/test/dummy/config/environments/development.rb | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for developme... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/dummy/config/environments/production.rb | actiontext/test/dummy/config/environments/production.rb | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.enable_reloading = false
# Eager load code on boot. This eager loads most of Rails and
# your app... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/attachable_test.rb | actiontext/test/unit/attachable_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::AttachableTest < ActiveSupport::TestCase
test "as_json is a hash when the attachable is persisted" do
freeze_time do
attachable = ActiveStorage::Blob.create_after_unfurling!(io: StringIO.new("test"), filename: "test.txt", key: 123)
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/strict_loading_test.rb | actiontext/test/unit/strict_loading_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::StrictLoadingTest < ActiveSupport::TestCase
class MessageWithStrictLoading < Message
self.strict_loading_by_default = true
has_rich_text :strict_loading_content
end
class MessageWithFooter < MessageWithStrictLoading
has_rich_tex... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/attachment_test.rb | actiontext/test/unit/attachment_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::AttachmentTest < ActiveSupport::TestCase
test "from_attachable" do
attachment = ActionText::Attachment.from_attachable(attachable, caption: "Captioned")
assert_equal attachable, attachment.attachable
assert_equal "Captioned", attachme... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/model_encryption_test.rb | actiontext/test/unit/model_encryption_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::ModelEncryptionTest < ActiveSupport::TestCase
test "encrypt content based on :encrypted option at declaration time" do
encrypted_message = EncryptedMessage.create!(subject: "Greetings", content: "Hey there")
assert_encrypted_rich_text_att... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/model_test.rb | actiontext/test/unit/model_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::ModelTest < ActiveSupport::TestCase
include QueryHelpers
test "html conversion" do
message = Message.new(subject: "Greetings", content: "<h1>Hello world</h1>")
assert_equal %Q(<div class="trix-content">\n <h1>Hello world</h1>\n</div>\... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/fixture_set_test.rb | actiontext/test/unit/fixture_set_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::FixtureSetTest < ActiveSupport::TestCase
def test_action_text_attachment
message = messages(:hello_world)
review = reviews(:hello_world)
attachments = review.content.body.attachments
assert_includes attachments.map(&:attachable)... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/content_test.rb | actiontext/test/unit/content_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::ContentTest < ActiveSupport::TestCase
test "equality" do
html = "<div>test</div>"
content = content_from_html(html)
assert_equal content, content_from_html(html)
assert_not_equal content, html
end
test "marshal serialization"... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/plain_text_conversion_test.rb | actiontext/test/unit/plain_text_conversion_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::PlainTextConversionTest < ActiveSupport::TestCase
test "<p> tags are separated by two new lines" do
assert_converted_to(
"Hello world!\n\nHow are you?",
"<p>Hello world!</p><p>How are you?</p>"
)
end
test "<blockquote> ta... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/trix_attachment_test.rb | actiontext/test/unit/trix_attachment_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::TrixAttachmentTest < ActiveSupport::TestCase
test "from_attributes" do
attributes = {
"data-trix-attachment" => {
"sgid" => "123",
"contentType" => "text/plain",
"href" => "http://example.com/",
"filename... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/editor_test.rb | actiontext/test/unit/editor_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::EditorTest < ActionView::TestCase
test "#as_canonical returns Fragment for storage" do
expected = "<div>hello, world</div>"
fragment = Fragment.wrap(expected)
editor = Editor.new
actual = editor.as_canonical(fragment)
assert... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/editor/registry_test.rb | actiontext/test/unit/editor/registry_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::Editor::RegistryTest < ActiveSupport::TestCase
test "inspect attributes" do
registry = ActionText::Editor::Registry.new({})
assert_match(/#<ActionText::Editor::Registry>/, registry.inspect)
end
test "inspect attributes with config" d... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/editor/trix_editor_test.rb | actiontext/test/unit/editor/trix_editor_test.rb | # frozen_string_literal: true
require "test_helper"
module ActionText
class Editor::TrixEditorTest < ActionView::TestCase
test "#as_canonical transforms Fragment for storage" do
expected = "<div>hello, world</div>"
fragment = Fragment.wrap(expected)
editor = ActionText::Editor::TrixEditor.new
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/unit/editor/configurator_test.rb | actiontext/test/unit/editor/configurator_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::Editor::ConfiguratorTest < ActiveSupport::TestCase
test "builds correct editor instance based on editor name" do
configurator = ActionText::Editor::Configurator.new(trix: {})
editor = configurator.build(:trix)
assert_instance_of Actio... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/test/template/form_helper_test.rb | actiontext/test/template/form_helper_test.rb | # frozen_string_literal: true
require "test_helper"
class ActionText::FormHelperTest < ActionView::TestCase
tests ActionText::TagHelper
def form_with(*, **)
@output_buffer = super
end
teardown do
I18n.backend.reload!
end
setup do
I18n.backend.store_translations("placeholder",
activere... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text.rb | actiontext/lib/action_text.rb | # frozen_string_literal: true
require "active_support"
require "active_support/rails"
require "action_text/version"
require "action_text/deprecator"
require "nokogiri"
# :markup: markdown
# :include: ../README.md
module ActionText
extend ActiveSupport::Autoload
autoload :Attachable
autoload :AttachmentGaller... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/content.rb | actiontext/lib/action_text/content.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
# # Action Text Content
#
# The `ActionText::Content` class wraps an HTML fragment to add support for
# parsing, rendering and serialization. It can be used to extract links and
# attachments, convert the fragment to plain text, or serializ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/system_test_helper.rb | actiontext/lib/action_text/system_test_helper.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module SystemTestHelper
# Locates a Trix editor and fills it in with the given HTML.
#
# The editor can be found by:
#
# * its `id`
# * its `placeholder`
# * the text from its `label` element
# * its `aria-la... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attachment_gallery.rb | actiontext/lib/action_text/attachment_gallery.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
class AttachmentGallery
include ActiveModel::Model
TAG_NAME = "div"
private_constant :TAG_NAME
class << self
def fragment_by_canonicalizing_attachment_galleries(content)
fragment_by_replacing_attachment_gallery_nodes... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/version.rb | actiontext/lib/action_text/version.rb | # frozen_string_literal: true
# :markup: markdown
require_relative "gem_version"
module ActionText
# Returns the currently loaded version of Action Text as a `Gem::Version`.
def self.version
gem_version
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/serialization.rb | actiontext/lib/action_text/serialization.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module Serialization
extend ActiveSupport::Concern
class_methods do
def load(content)
new(content) if content
end
def dump(content)
case content
when nil
nil
when self
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attribute.rb | actiontext/lib/action_text/attribute.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module Attribute
extend ActiveSupport::Concern
class_methods do
# Provides access to a dependent RichText model that holds the body and
# attachments for a single named rich text attribute. This dependent attribute
# is l... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/fragment.rb | actiontext/lib/action_text/fragment.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
class Fragment
class << self
def wrap(fragment_or_html)
case fragment_or_html
when self
fragment_or_html
when Nokogiri::XML::DocumentFragment # base class for all fragments
new(fragment_or_html)... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/encryption.rb | actiontext/lib/action_text/encryption.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module Encryption
def encrypt
transaction do
super
encrypt_rich_texts if has_encrypted_rich_texts?
end
end
def decrypt
transaction do
super
decrypt_rich_texts if has_encrypted_rich_text... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/trix_attachment.rb | actiontext/lib/action_text/trix_attachment.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
# DEPRECATED
class TrixAttachment
TAG_NAME = "figure"
SELECTOR = "[data-trix-attachment]"
COMPOSED_ATTRIBUTES = %w( caption presentation )
ATTRIBUTES = %w( sgid contentType url href filename filesize width height previewable cont... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/rendering.rb | actiontext/lib/action_text/rendering.rb | # frozen_string_literal: true
# :markup: markdown
require "active_support/core_ext/module/attribute_accessors_per_thread"
module ActionText
module Rendering # :nodoc:
extend ActiveSupport::Concern
included do
thread_cattr_accessor :renderer, instance_accessor: false
delegate :render, to: :clas... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attachment.rb | actiontext/lib/action_text/attachment.rb | # frozen_string_literal: true
# :markup: markdown
require "active_support/core_ext/object/try"
module ActionText
# # Action Text Attachment
#
# Attachments serialize attachables to HTML or plain text.
#
# class Person < ApplicationRecord
# include ActionText::Attachable
# end
#
# ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/plain_text_conversion.rb | actiontext/lib/action_text/plain_text_conversion.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module PlainTextConversion
extend self
def node_to_plain_text(node)
BottomUpReducer.new(node).reduce do |n, child_values|
plain_text_for_node(n, child_values)
end.then(&method(:remove_trailing_newlines))
end
pr... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/html_conversion.rb | actiontext/lib/action_text/html_conversion.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module HtmlConversion
extend self
def node_to_html(node)
node.to_html(save_with: Nokogiri::XML::Node::SaveOptions::AS_HTML)
end
def fragment_for_html(html)
document.fragment(html)
end
def create_element(tag_na... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/editor.rb | actiontext/lib/action_text/editor.rb | # frozen_string_literal: true
module ActionText
class Editor # :nodoc:
extend ActiveSupport::Autoload
autoload :Configurator
autoload :Registry
attr_reader :options
def initialize(options = {})
@options = options
end
# Convert fragments served by the editor into the canonical fo... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/deprecator.rb | actiontext/lib/action_text/deprecator.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
def self.deprecator # :nodoc:
@deprecator ||= ActiveSupport::Deprecation.new
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/fixture_set.rb | actiontext/lib/action_text/fixture_set.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
# # Action Text FixtureSet
#
# Fixtures are a way of organizing data that you want to test against; in short,
# sample data.
#
# To learn more about fixtures, read the ActiveRecord::FixtureSet documentation.
#
# ### YAML
#
# Like ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/engine.rb | actiontext/lib/action_text/engine.rb | # frozen_string_literal: true
# :markup: markdown
require "rails"
require "action_controller/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_text"
require "action_text/trix"
module ActionText
class Engine < Rails::Engine
isolate_namespace ActionText
config.eager_lo... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/gem_version.rb | actiontext/lib/action_text/gem_version.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
# Returns the currently loaded version of Action Text as a `Gem::Version`.
def self.gem_version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 8
MINOR = 2
TINY = 0
PRE = "alpha"
STRING = [MAJOR, MINOR... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attachable.rb | actiontext/lib/action_text/attachable.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
# # Action Text Attachable
#
# Include this module to make a record attachable to an ActionText::Content.
#
# class Person < ApplicationRecord
# include ActionText::Attachable
# end
#
# person = Person.create! name... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attachables/remote_image.rb | actiontext/lib/action_text/attachables/remote_image.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module Attachables
class RemoteImage
extend ActiveModel::Naming
class << self
def from_node(node)
if remote_url?(node["url"]) && content_type_is_image?(node["content-type"])
new(attributes_from_node(no... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attachables/missing_attachable.rb | actiontext/lib/action_text/attachables/missing_attachable.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module Attachables
class MissingAttachable
extend ActiveModel::Naming
DEFAULT_PARTIAL_PATH = "action_text/attachables/missing_attachable"
def initialize(sgid)
@sgid = SignedGlobalID.parse(sgid, for: ActionText::Attac... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attachables/content_attachment.rb | actiontext/lib/action_text/attachables/content_attachment.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module Attachables
class ContentAttachment # :nodoc:
include ActiveModel::Model
def self.from_node(node)
attachment = new(content_type: node["content-type"], content: node["content"])
attachment if attachment.valid?... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/editor/registry.rb | actiontext/lib/action_text/editor/registry.rb | # frozen_string_literal: true
module ActionText
class Editor::Registry # :nodoc:
def initialize(configurations)
@configurations = configurations.to_h
@editors = {}
end
def fetch(name)
editors.fetch(name.to_sym) do |key|
if configurations.include?(key)
editors[key] = c... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/editor/trix_editor.rb | actiontext/lib/action_text/editor/trix_editor.rb | # frozen_string_literal: true
module ActionText
class Editor::TrixEditor < Editor # :nodoc:
def as_canonical(editable_fragment)
editable_fragment.replace(TrixAttachment::SELECTOR, &method(:from_trix_attachment))
end
def as_editable(canonical_fragment)
canonical_fragment.replace(Attachment.ta... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/editor/configurator.rb | actiontext/lib/action_text/editor/configurator.rb | # frozen_string_literal: true
module ActionText
class Editor::Configurator # :nodoc:
attr_reader :configurations
def initialize(configurations)
@configurations = configurations
end
def build(editor_name)
editor_class = resolve(editor_name.to_s)
options = config_for(editor_name.to_... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attachments/minification.rb | actiontext/lib/action_text/attachments/minification.rb | # frozen_string_literal: true
# :markup: markdown
module ActionText
module Attachments
module Minification
extend ActiveSupport::Concern
class_methods do
def fragment_by_minifying_attachments(content)
Fragment.wrap(content).replace(ActionText::Attachment.tag_name) do |node|
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actiontext/lib/action_text/attachments/conversion.rb | actiontext/lib/action_text/attachments/conversion.rb | # frozen_string_literal: true
# :markup: markdown
require "active_support/core_ext/object/try"
module ActionText
module Attachments
module Conversion # :nodoc:
extend ActiveSupport::Concern
class_methods do
def fragment_by_converting_editor_attachments(content)
canonical_fragment... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.