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

Redactor Rails renders multiple forms #151

Open
tbcooney opened this issue Aug 17, 2015 · 16 comments
Open

Redactor Rails renders multiple forms #151

tbcooney opened this issue Aug 17, 2015 · 16 comments

Comments

@tbcooney
Copy link

screen shot 2015-08-17 at 3 40 20 pm
screen shot 2015-08-17 at 3 37 52 pm

Creating or updating a post renders multiple forms at first, but if you refresh the view the problem is fixed.

@jaymiejones86
Copy link

I have also experienced this issue.

@tbcooney
Copy link
Author

@jaymiejones86 Oh geesus, I spent 45 minutes trying to fix it earlier after following these steps for install, and got no where:

  1. Add 'redactor-rails' gem to Gemfile
  2. bundle install
  3. Include in application.js & application.css.scss
  4. = f.input :content, :input_html => { :class => "redactor" }

Again, the editor works and the view is fixed on refresh but it is still an error. Ended up tagging this as an Issue and wonder if there is a fix or a text editor that won't do this.

@jaymiejones86
Copy link

@tbcooney we had similar issues, only 2 instances of the editor though and the 2 instances showed pretty much all the time.

@jaymiejones86
Copy link

I would also note there was no issue back with 0.4.2

@tbcooney
Copy link
Author

@jaymiejones86 I just reverted to 0.4.2 and I get only 2 instances of the editor, however, the extra instance will disappear on refresh, weird. When I reverted to 0.3.7 the issue was no longer present (not the best fix lol).

@jaymiejones86
Copy link

@tbcooney hmmm so odd. Ill need to find some spare time to look and maybe issue a PR, but hope someone else beats me to it.

@lucasklaassen
Copy link

Had the same issue and messed around with how the JavaScript was initalizing the editor. It worked fine in development but when deployed it would render two editors in production. I'll look back on my commit notes and try to find the fix for you guys.

@brunnogomes
Copy link

Hi guys, I'm also having the same issue. It renders 2 instances of the editor, however even refreshing does not help.

I already revised the initialization code but not luck.

Anyone got any progress on this?

/cc @lucasklaassen @jaymiejones86 @tbcooney

@jaymiejones86
Copy link

@brunnogomes we found that you did not have to have initialisation code if you just want the defaults and are hooking into a class redactor.

If you do some initialisation, make sure the class name is not redactor.

@levelingup
Copy link

This happened to me too... I realized that I added a class: "redactor" and initialized it in my javascript code. So if you're going to initialize it, use a different class.

@brunnogomes
Copy link

Thanks @jaymiejones86!

@jaymiejones86
Copy link

No worries Brunno.
On Fri, 18 Dec 2015 at 5:30 AM, Brunno Gomes [email protected]
wrote:

Thanks @jaymiejones86 https://github.com/jaymiejones86!


Reply to this email directly or view it on GitHub
#151 (comment)
.

Jaymie Jones
@pixelstackcom
http://jaymiejonesphoto.com
http://codercatchup.com
https://devbase.io

@sankalpsingha
Copy link

Thanks for this info. I was really confused what the issue was. So I just changed the class name from .redactor to .redactor-row in the config.js and called that class in the text areas. Done! 💃

@jaymiejones86
Copy link

No worries @sankalpsingha
Happy redactoring.

@bigos
Copy link

bigos commented Aug 29, 2016

Perhaps it's not exactly the right solution, but I have a quick fix in my fork.
https://github.com/bigos/redactor-rails
I have modified gem to use all the plug-ins and get rid of duplicate forms.

Gemfile:
gem 'redactor-rails', github: 'bigos/redactor-rails', branch: 'master'

application.js
//= require redactor-rails
//= require redactor-rails/plugins

application.css
*= require redactor-rails
*= redactor-rails/plugins

@bigos
Copy link

bigos commented Aug 29, 2016

Link to the diff bigos@ac2cc62

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

No branches or pull requests

7 participants