Comments (7)
Hmm, I'm not seeing this. Can you upload a test app to GitHub that demonstrates the issue?
from tinymce-rails.
I think I'm having a similar issue, but haven't pinpointed it yet.
The form (and TinyMCE) display properly in the browser.
But fails in the spec.
This is a request spec with Capybara:
1) Creating an Article saves correctly when filled with valid data
Failure/Error: visit new_article_path
ActionView::Template::Error:
undefined method `tinymce' for #<#<Class:0x007fe23ac17018>:0x007fe23c9b0fe8>
# ./app/views/articles/_form.html.erb:19:in `_app_views_articles__form_html_erb__1243779275900824040_70304831220100'
# ./app/views/articles/new.html.erb:1:in `_app_views_articles_new_html_erb___3793578565898622305_70304795223600'
# ./app/controllers/articles_controller.rb:21:in `new'
# ./spec/requests/create_article_spec.rb:6:in `block (2 levels) in <top (required)>'
The bug just appeared after this sigle change in the project:
diff --git a/Gemfile.lock b/Gemfile.lock
index f660606..5dd9651 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -23,12 +23,12 @@ GEM
rack-cache (~> 1.1)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
- activeadmin (0.4.3)
+ activeadmin (0.4.4)
bourbon (>= 1.0.0)
devise (>= 1.1.2)
fastercsv
- formtastic (>= 2.0.0)
- inherited_resources (> 0)
+ formtastic (~> 2.1.1)
+ inherited_resources (>= 1.3.1)
jquery-rails (>= 1.0.0)
kaminari (>= 0.13.0)
meta_search (>= 0.9.2)
@@ -59,7 +59,7 @@ GEM
autotest-growl (0.2.16)
backports (2.3.0)
bcrypt-ruby (3.0.1)
- bourbon (1.4.0)
+ bourbon (2.1.0)
sass (>= 3.1)
builder (3.0.0)
capistrano (2.11.2)
@@ -131,7 +131,7 @@ GEM
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
- json (1.6.6)
+ json (1.7.3)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
@@ -215,7 +215,7 @@ GEM
rspec (~> 2.0)
ruby-graphviz (1.0.5)
rubyzip (0.9.6.1)
- sass (3.1.16)
+ sass (3.1.18)
sass-rails (3.2.4)
railties (~> 3.2.0)
sass (>= 3.1.10)
@@ -237,7 +237,7 @@ GEM
sinatra (~> 1.3.0)
tilt (~> 1.3)
spork (0.9.0)
- sprockets (2.1.2)
+ sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
Could any of these updates have triggered a change?
from tinymce-rails.
@czak I wouldn't have thought any of those updates would affect tinymce-rails
. Would you perhaps be able to trace the issue by starting with a fresh app?
from tinymce-rails.
Ok sorry my bad, the bug appeared after another (also seemingly irrelevant) commit.
I'm monkeypatching ActiveAdmin from an initializer.
This is enough to make the tinymce
testing bug appear:
config/initializers/active_admin_monkeypatch.rb
module ActiveAdmin
module Devise
end
end
I'll try to whip up a sample app when I have some time.
from tinymce-rails.
Here you go: https://github.com/czak/tinymce-rails-bug-app
- commit 3cc25a7d breaks the spec
- obviously this is a convoluted example and I deserve to be punished for monkeypatching
- but still, this seems weird and maybe it will help in some way
from tinymce-rails.
I'm still looking into this but you can take ActiveAdmin out of the equation at least, which leaves Devise as a possible source of the issue. The following in your initializer is enough to trigger the issue:
::Devise::DeviseController
from tinymce-rails.
Can you confirm that this commit fixes the issue for you?
The issue turned out to be exposed simply by referencing ApplicationController
within the initializer (which is what Devise::DeviseController
was loading). At this point, ApplicationController
creates its own module for its helpers, however tinymce-rails has not yet been initialized. When the tinymce-rails initializers are finally run, they were adding the helpers to ActionController::Base
but these helpers were not propagating down to ApplicationController
's helpers.
from tinymce-rails.
Related Issues (20)
- How to show formatted content?
- Missing 5.10.5 update HOT 1
- valid_styles compiles incorrectly for v6 HOT 2
- Couldn't find file 'tinymce-jquery' HOT 2
- Configuring init_instance_callback does not work with string or arrow function HOT 3
- Doesn't work with multiple visits HOT 5
- tinymce fonts are not loading correctly HOT 4
- TinyMCE is stripping HTML code for YouTube iFrame embed, therefore the embed is not displaying HOT 2
- Getting Rails 7 Stimulus controllers to work with Tinymce
- Upgraded tinymce-rails from 5.2 to 6.4.2 and default silver theme is not working HOT 3
- How to use it with paid plugins HOT 2
- Does not work with Propshaft / cssbundling-rails,? HOT 3
- Problem with deploy on production HOT 6
- Can't init editor manually HOT 1
- Rails 7 with Importmaps - TinyMCERails is not defined HOT 4
- Question: How to pass api_key with this gem? HOT 1
- Turbo + TinyMCE — doesn't reinit the editor after a Turbo interaction HOT 2
- Update to TinyMCE 7.0.0
- Wrong license on main branch (since version 7) HOT 1
- Missing release/tag - 4.9.11.1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinymce-rails.