Skip to content

Add rich_text_area#193

Open
kalashnikovisme wants to merge 1 commit into
mainfrom
rich_text_area
Open

Add rich_text_area#193
kalashnikovisme wants to merge 1 commit into
mainfrom
rich_text_area

Conversation

@kalashnikovisme
Copy link
Copy Markdown
Member

What's changed basically?

Added Tramway support for Action Text rich text fields.

  • Tramway::Form::Builder#rich_text_area
  • Tramway::Form::Builder#rich_textarea
  • tramway_field :rich_text_area
  • Dark Tailwind/Trix editor and toolbar styling
  • Form titles on edit pages now use the record title when available
  • README docs were updated with the new helper

What's changed for tramway drivers?

Tramway forms can now render Action Text/Trix editors with Tramway form styling.

Before

class PostForm < Tramway::BaseForm
  fields :title, :text
end

<%= f.text_area :text %>

After

  class PostForm < Tramway::BaseForm
    fields :title, :rich_text_area
  end

  <%= f.rich_text_area :bio %>

rich_text_area keeps custom classes/data attributes and marks the editor so Tramway
JavaScript can style the Trix toolbar consistently with the dark form UI.

Docs updated in README:
https://github.com/Purple-Magic/tramway/blob/rich_text_area/README.md#tramway_form_for

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant