fixlr / codemirror-rails Goto Github PK
View Code? Open in Web Editor NEWUse CodeMirror with Rails
Home Page: https://rubygems.org/gems/codemirror-rails
License: MIT License
Use CodeMirror with Rails
Home Page: https://rubygems.org/gems/codemirror-rails
License: MIT License
Versions 3.23 and 4.0 were released on 2014-3-20.
Sorry if I'm impatient, but I'm excited about the new features in 4.0! Thanks for maintaining this gem.
http://codemirror.net/codemirror-3.23.zip
http://codemirror.net/codemirror-4.0.zip
https://github.com/codemirror/CodeMirror/releases/tag/5.4.0
thanks in advance ๐
Hi, I was trying to figure out why my rails codemirror editor was buggy where the demo editor on the codemirror site is not, when running coffeescript mode on ios safari.
turns out if i just replace codemirror-rails's codemirror.js v4.8 with the current codemirror 5.0, it fixes the problem.
could you please update the version of codemirror.js? if the only files that need to change are codemirror.js and .css, i'd be happy to create a pull request with those changes.
It would be nice if the readme file have an example in views. Thanks.
On an existing old rails application now running on codemirror-rails 5.3, that worked before, in current Chrome and Firefox I suddenly get the Javascript error messages
Uncaught TypeError: CodeMirror.multiplexingMode is not a function
Uncaught TypeError: Cannot read property 'startState' of undefined
and the warning
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
I didn't enable anything special and I have currently no idea what's going on here.
Same application on the server with 5.2 has no issues.
No I went back in development to 5.2, but that didn't help.
Any suggestions or ideas welcome!
Can you please update to the latest version of CodeMirror (4.7.0 at this time)?
Bundler could not find compatible versions for gem "railties":
In Gemfile:
codemirror-rails (>= 0) ruby depends on
railties (~> 3.0) ruby
rails (= 4.0.0.rc1) ruby depends on
railties (4.0.0.rc1)
I'm inclined to switch the codemirror-rails version numbers to match CodeMirror proper's stable releases. For example, I would publish codemirror-rails v2.2 to match CodeMirror's recent v2.2, instead of publishing it as codemirror-rails v0.3.3.
The current numbering convention seems pointless for a gem that only changes when the vendored assets change.
Thoughts? Suggestions?
Doesn't seem to work when adding as addon, what is the correct syntax for application.js?
Hey, was wondering if you have any intention of including the keymap dir from upstream. Not that it's hard to bring those into a Rails project manually, just seems like it makes sense that this gem would include it.
Thoughts?
I ran a test with rails '~> 5.2.0', and it fails as:
undefined method `env' for Rails:Module (NoMethodError)
Full log:
https://travis-ci.org/alee-ccu/codemirror-rails/jobs/462776706
https://github.com/codemirror/CodeMirror/releases/tag/5.11.0
Thanks in advance ๐ฏ
What is the timeline for updating this gem for 5.5.0 (https://github.com/codemirror/CodeMirror/releases/tag/5.5.0) ? Any estimate is great - thanks.
New version of CodeMirror landed recently. Is a new gem release on the way?
Hey, I have followed your instructions as best I could on Rails 3.2, with the only change that I added the files to the specific view that I needed them in, rather than application.js|css
I do see the below in the source
<link href="/assets/codemirror.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/codemirror.js" type="text/javascript"></script>
<script src="/assets/codemirror/modes/ruby.js" type="text/javascript"></script>
How ever, firefox dev tools doesnt show the javascript files as loaded, and I am getting the error mentioned in the title.. Is there something I am missing?
Hi, I tried to adjust the .gemspec to allow Rails 4.1 and got:
$ bundle exec rake
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
* development - set it to false
* test - set it to false (unless you use a tool that preloads your test environment)
* production - set it to true
/home/strzibny/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `mass_assignment_sanitizer=' for #<Class:0x00000003167af8> (NoMethodError)
from /home/strzibny/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/railtie.rb:110:in `block (3 levels) in <class:Railtie>'
from /home/strzibny/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/railtie.rb:109:in `each'
from /home/strzibny/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/railtie.rb:109:in `block (2 levels) in <class:Railtie>'
from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/strzibny/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/base.rb:326:in `<module:ActiveRecord>'
from /home/strzibny/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/base.rb:23:in `<top (required)>'
from /home/strzibny/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/relation/predicate_builder.rb:111:in `<class:PredicateBuilder>'
from /home/strzibny/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/relation/predicate_builder.rb:2:in `<module:ActiveRecord>'
Development dep shouldn't be restricted to Rails < 4 since the gem itself Rails 4 supports:
https://github.com/fixlr/codemirror-rails/blob/master/codemirror-rails.gemspec#L17
Hey Fixlr - this is an awesome gem so thanks a ton for making this!
I've been using it here: http://www.graf.ly/graph_templates/new. Javascript and CSS works fine. When I try to use mode: "text/html", the mode does not seem to be enabled (plain black text, no smart formatting, etc).
Is this mode not included with codemirror-rails? Or is it supposed to function and something else is wrong?
Code sample:
var myEditor = CodeMirror.fromTextArea($('myEditorTextarea'), {
lineNumbers: true,
mode: 'text/html',
lineWrapping: true
});
Hi, trying to update a rails from 5.2 to 6.0 and codemirror-rails
is blocking it.
from bundle update rails
I get the following error:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
codemirror-rails was resolved to 5.16.0, which depends on
railties (< 6.0, >= 3.0)
Example:
<textarea disabled="disabled"></textarea>
... could load CodeMirror in readonly mode.
Is it possible to lazy load modes? I was thinking in RequireJS, but I think it won't play nice with asset pipeline.
On the official docs I found this demo:
Hello, is it possible to had https://github.com/emmetio/codemirror to this gem?
when I update the gem to gem 'codemirror-rails', '3.12'
,and then run
rake assets:precompile
it fails with error invalid byte sequence in UTF-8
but it works when I downgrade it back to version 3.02
Could you please push the tags for the latest releases? They are missing in the repository. Thank you.
Current is 5.31.0, one frozen in the gem 5.16.0. It's been a while.
Karina's comment: Perhaps for the questions asking about citizenship etc, we could leave the drop-down blank rather than having it pre-population
3024-theme is not available
Hi,
After installing the gem (tried both via command line and gemfile), and requiring the assets in both application.js and application.css, I get the error:
couldn't find file 'codemirror'
when trying to run
rails generate codemirror:install
I get:
Could not find generator codemirror:install.
Is there any chance that the necessary files aren't getting added installed?
It seems that 5.1 has been released for a while. Can you please update everything to 5.1?
Hi just wondering, since the default style no longer exists, which style was used for the default originally?
Not sure if it's like this for everyone else, but in my Rails application, require_tree at the application.js will give me an error, as it will not find the addon. Instead, "//= require codemirror/addons/mode/" will do it.
Hi,
rails generate
does not list the generator on rails 4.1 additionally, the generator cannot be found if manually invoked.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.