Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple rich text fields - ActionText #37399

Closed
stingo opened this issue Oct 8, 2019 · 4 comments
Closed

Multiple rich text fields - ActionText #37399

stingo opened this issue Oct 8, 2019 · 4 comments
Labels

Comments

@stingo
Copy link

stingo commented Oct 8, 2019

Steps to reproduce

I''m generating multiple rich text fields on a rails 6 form.

Actual behavior

Only first field is storing in the database. The remaining fields are not showing on the db at all. Can a form use multiple rich text fields?

module.rb
has_rich_text :content
has_rich_text :references
has_rich_text :footnotes

_form.html.erb
f.rich_text_area :content
f.rich_text_area :references
f.rich_text_area :footnotes

controller.rb
params.require... :content, :references, :footnotes...

System configuration

Rails 6:

Ruby 2.6.5:

@rails-bot
Copy link

rails-bot bot commented Jan 6, 2020

This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 6-0-stable branch or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.

@rails-bot rails-bot bot added the stale label Jan 6, 2020
@rails-bot rails-bot bot closed this as completed Jan 13, 2020
@ChaseFlorom
Copy link

I'm having the same problem...Shame this got closed.

@abhaynikam
Copy link
Contributor

@ChaseFlorom I was not able to reproduce this issue on Rails master and version 6.0.0.2. Multiple rich text fields are working properly and data is saved in the database for all the fields. If you could provide an app that reproduces the issue please let me know I'll try to investigate the issue. cc/ @stingo

@ghost
Copy link

ghost commented Aug 28, 2020

Experienced this today after installing action_text from a newly upgraded Rails 6 app(previously 5.2).

Fixed this by manually assigning unique id attribute values to each of the input field.

Ex:

form.rich_text_area :first_description, id: 'trix_first_description'
form.rich_text_area :second_description, id: 'trix_second_description'
form.rich_text_area :third_description, id: 'trix_third_description'

I think the cause is action_text automatically assign id's to the rich text fields and uses only one id value to all rich text field it finds.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants