ejholmes / active_admin_editor Goto Github PK
View Code? Open in Web Editor NEWRich text editor for Active Admin using wysihtml5.
License: MIT License
Rich text editor for Active Admin using wysihtml5.
License: MIT License
Using Rails 3.2.22
Here's the console stack trace:
Uncaught ReferenceError: JST is not defined
at Editor._addToolbar (http://intranet.lvh.me:3000/assets/active_admin/editor/editor.js?body=1:29:20)
at new Editor (http://intranet.lvh.me:3000/assets/active_admin/editor/editor.js?body=1:13:10)
at HTMLLIElement.<anonymous> (http://intranet.lvh.me:3000/assets/jquery-ui.js?body=1:508:30)
at Function.each (http://intranet.lvh.me:3000/assets/jquery.js?body=1:658:23)
at init.each (http://intranet.lvh.me:3000/assets/jquery.js?body=1:267:17)
at init.$.fn.(anonymous function) [as editor] (http://intranet.lvh.me:3000/assets/jquery-ui.js?body=1:503:9)
at HTMLDocument.<anonymous> (http://intranet.lvh.me:3000/assets/active_admin/editor.js?body=1:6:36)
at fire (http://intranet.lvh.me:3000/assets/jquery.js?body=1:3065:30)
at Object.fireWith [as resolveWith] (http://intranet.lvh.me:3000/assets/jquery.js?body=1:3177:7)
at Function.ready (http://intranet.lvh.me:3000/assets/jquery.js?body=1:434:13)
Within editor.js it's referring to this method where JST is being referenced:
/**
* Adds the wysihtml5 toolbar. If uploads are enabled, also adds the
* necessary file inputs for uploading.
*/
Editor.prototype._addToolbar = function() {
var template = JST['active_admin/editor/templates/toolbar']({
id: this.$el.attr('id') + '-toolbar'
})
this.$toolbar = $(template)
if (config.uploads_enabled) {
var _this = this
this.$toolbar.find('input.uploadable').each(function() {
_this._addUploader(this)
})
}
this.$el.find('.wrap').prepend(this.$toolbar)
}
I haven't done anything with the initialization file yet - I don't want to upload images. Do I still need to fill this out?
Images I upload are sometimes very large, I would like to set the style of the editor window to have images have a max-width
of 100%
Maybe I'm missing some thing but let's say I have the following layout where I have :text
in a nested field using as: :html_editor
. This does not work. It only works if it's not a nested attribute i.e. :name
. Any ideas how to fix?
form do |f|
f.inputs "Section Details" do
f.semantic_errors
f.input :district, :collection => AbqDistricts::District.all.map {|u| [u.name, u.id]}, :include_blank => false
f.input :name
para "Do not use shortened urls e.g. 'http://bit.ly/1dNVPAW' for images. Only use full urls e.g. 'http://www.somewhere.com/someimage.jpg'", style: 'color:red;padding-left:10px;'
f.inputs 'List Items' do
f.has_many :list_items do |item|
item.input :item_type, as: :select, collection: ["", "list_item", "media", "text"], :include_blank => false, input_html: {onchange: "itemSelected(this)"}
item.input :text, as: :html_editor
item.input :link, input_html: {class: "item-select-type"}
end
end
end
f.actions
end
end
Hi, when I try to precompile my assets the rake task stops saying it can't find that stylesheet.
I followed all the instructions, but it doesn't work.
[ngw@number13:~/sportboom-core]$ rake assets:precompile:all --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
couldn't find file 'active_admin/editor/wysiwyg'
(in /Users/ngw/sportboom-core/app/assets/javascripts/application.js:16)
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:100:in resolve' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:140:in
require_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:215:in process_require_directive' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:165:in
block in process_directives'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:163:in each' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:163:in
process_directives'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:97:in evaluate' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/tilt-1.3.3/lib/tilt/template.rb:76:in
render'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:177:in block in evaluate' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:174:in
each'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:174:in evaluate' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/processed_asset.rb:12:in
initialize'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:241:in new' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:241:in
block in build_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:262:in circular_call_protection' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:240:in
build_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:89:in block in build_asset' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/caching.rb:19:in
cache_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:88:in build_asset' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:163:in
find_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:56:in find_asset' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/bundled_asset.rb:16:in
initialize'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:244:in new' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:244:in
build_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:89:in block in build_asset' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/caching.rb:19:in
cache_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:88:in build_asset' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:163:in
find_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:56:in find_asset' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/environment.rb:74:in
find_asset'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.6/lib/sprockets/static_compiler.rb:23:in block in compile' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:212:in
block in each_logical_path'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:200:in block (2 levels) in each_file' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in
each'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in each_entry' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:198:in
block in each_file'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in each' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in
each_file'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:210:in each_logical_path' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.6/lib/sprockets/static_compiler.rb:18:in
compile'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.6/lib/sprockets/assets.rake:56:in internal_precompile' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.6/lib/sprockets/assets.rake:70:in
block (3 levels) in <top (required)>'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
block in execute'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
execute'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in block in invoke_with_call_chain' /Users/ngw/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in
invoke'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.6/lib/sprockets/assets.rake:60:in block (3 levels) in <top (required)>' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
call'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in block in execute' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
each'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in execute' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
block in invoke_with_call_chain'
/Users/ngw/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in invoke' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
invoke_task'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block (2 levels) in top_level' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
each'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block in top_level' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in top_level' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
block in run'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
run'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in <top (required)>' /Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in
load'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in <main>' /Users/ngw/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in
eval'
/Users/ngw/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `
Any guess?
When uploading images via Assets > Images, image uploads work fine. However, when using the uploader modal in the editor itself, carrierwave returns storage
and dimensions
as nil. The ImageAsset does save correctly, but it fails to process the uploaded image.
I poked around quite a bit, but nothing in the gem seems to be configured incorrectly. It's as if calling @image_asset.save!
on line 51 of assets.rb doesn't care about the mount_uploader
param in image_asset.rb
Any ideas?
Is there a way to customize the Toolbar?
First of all, thank you for developing the gem, it's incredibly usefull in the projects I currently work, but I was wondering if there is a way to not generate a div tag when using the editor.
I ask this because I need to show part of the text in a view and there is the starting
Is there a way to not generate a div tag when using the editor?
Thanks.
Started GET "/admin/posts/new" for 87.245.186.102 at 2013-02-20 13:11:52 +0000
Processing by Admin::PostsController#new as HTML
Rendered /home/shaelf/www/**********/shared/bundle/ruby/1.9.1/gems/activeadmin-0.5.1/app/views/active_admin/resource/new.html.arb (593.5ms)
Completed 500 Internal Server Error in 951ms
ActionView::Template::Error ( isn't precompiled):
1: insert_tag renderer_for(:new)
app/admin/posts.rb:14:in block (4 levels) in <top (required)>' app/admin/posts.rb:13:in
block (3 levels) in <top (required)>'
app/admin/posts.rb:12:in `block (2 levels) in <top (required)>'
ActiveAdmin.register Post do
form do |f|
f.inputs "Main" do
f.input :title
f.input :category
f.input :lid, as: :html_editor
f.input :text, as: :html_editor
f.input :slug
end
end
end
Hi, I notice that pasting iframes for embedded videos doesn't work in source mode.
However this is active_admin, not a forum. We should be able to embed videos in our website news. So it makes sense in the original editor, but we have to override this behavior in active_admin_editor.
Here is how we will input html code:
ActiveAdmin.register Page do
form do |f|
f.inputs do
f.input :title
f.input :content, as: :html_editor
end
f.buttons
end|
How to write show ?
I'm following your example but when it comes to the image it's doesn't work.
in my Gemfile
41 gem "activeadmin"
42
43 gem "rmagick"
44 gem 'fog'
45 gem "carrierwave"
46
47 gem 'active_admin_editor', :git => 'https://github.com/ejholmes/active_admin_editor.git'
My config
c/i/active_admin_editor.rb
1 ActiveAdmin::Editor.configure do |config|
2 config.s3_bucket = 'laguiltiere'
3 config.aws_access_key_id = 'AKIAJ5NKFSKSKGNYEYJQ'
4 config.aws_access_secret = 'xx'
5 config.storage_dir = 'uploads'
6 end
very simple setup that doesn't work, i'm missing something?
When I click the source button and paste new HTML into it, it gets all screwed up. It gets removed, is missing specific parts. What causes this? What is the way to fix it?
Many folks trying to disable style filtering from tags, can't find solution and switch to ckeditor. I'm appreciate your gem much, but I'm not good in javascript and couldn't disable filtering as well.
I mean: I have code ike this <div class="page-slider-info__section">
when I paste it into your editor it becomes <div>
. I can't into Rules section cause it weak documented.
Hope my feedback helps.
Thank you for the project.
Is there any way of localizing the editor controls?
Deploying to heroku I've seen some problems when this is set to true.
For some reason, formtastic does not reload some classes when it's needed. So I see things like:
NoMethodError: undefined method `editor' for #<ActiveAdmin::Application:0x007f08134ae5f8>
ActionView::Template::Error (Unable to find input class HtmlEditorInput)
/app/config/initializers/active_admin_editor.rb:1:in `<top (required)>': uninitialized constant ActiveAdmin::Editor (NameError)
See: rails/spring#95 for references.
I was able to make a workaround for this error, prepending this to the initializer:
require 'active_admin_editor'
require "#{Gem::Specification.find_by_name("active_admin_editor").gem_dir}/app/inputs/html_editor_input"
This is problem an error more related to Formtastic than to this gem, but this should be useful for someone who has the same problem.
There is an error in line:
selectedScale = ->
image_dialog.find('input[@name="asset_scale"]:checked').data('scale')
I think ther shouldn't be @ sign before name...
It occure with Uncaught Error: Syntax error, unrecognized expression: [@name="asset_scale"]:checked when clicked on image after upload.
Chrome 18.0.1025.168 (Developer Build 134367 Linux) Ubuntu 12.04 was used
active_admin_editor 0.3.5
active_admin 0.4.4
I love this gem and have successfully used it for several years. For some reason, I just started getting this error:
ActionController::UnpermittedParameters in Admin::PostsController#create
I tried adding :_wysithml5_mode as a permitted param, but that did not work.
I'm running:
activeadmin 1.0.0.pre2
Rails 4.2.4
Ruby 2.2.3
Thanks in advance.
I already configured my s3 in active_admin_editor.rb, and I typedActiveAdmin::Editor.configuration.s3_configured?
in console and it's true.
But I still don't know where to upload my image, can you help me?
I thought I configured active_admin_editor correctly, but when I click the Image upload button, nothing happens. I looked at the network inspector and I can see a GET http://localhost:3000/admin/image_assets.json
with a 500 response code every time I click on it.
I'm currently on Rails 3.2.8 with Active Admin 0.4.4
Hi,
I've follow the instruction in the docs. setup the aws credentials in initializers.
added cors configuration to the bucket but still get this error "Response for preflight is invalid (redirect)?
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
I'm trying to customize the buttons on the ribbon. According to the documentation, I've set up on initializers/active_admin_editor.rb just to test it:
ActiveAdmin::Editor.configure do |config|
config.parser_rules['tags']['h1'] = {
'remove' => 1
}
config.parser_rules['tags']['h2'] = {
'remove' => 1
}
config.parser_rules['tags']['h3'] = {
'remove' => 1
}
end
But no avail. I did
rm -rf tmp/cache
As suggested on the docs and I restarted the server several times, but still the change makes no effect, and the h1, h2, h3 buttons are still showing up. What could be the problem?
Hello,
I want to be able to emmed youtube videos using the iframe youtube provides, but in app/assets/javascripts/active_admin/editor/parser_rules.js, the iframe tag is set to 'remove=1'
If I understand it correctly, I need to make a fork of your project just to change that rule and possibly getting out of sync :( (If there is another way to insert videos, plese tell me)
I think it would be a great addition to be able to modify the tags section of the parser via the initializer used to set S3 options.
Could you enlighten me a bit about this issue, please?
Thanks
I cant figure this out so last resort to post it here
The gemspec at /home/chris/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/active_admin_editor-86f964be3071/active_admin_editor.gemspec is not valid. The validation error was 'duplicate dependency on activeadmin (> 0.4.3, development), (>= 0.4.0) use:> 0.4.3', '>= 0.4.0'
add_runtime_dependency 'activeadmin', '
let me know if/what you need
rails g active_admin:editor
produces:
...active_record/connection_adapters/abstract/connection_pool.rb:404:in
retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)`
because it somehow relies on active record even though it just moves a css file
many projects may stop including active record when using mongoid or alternatives
Is there any way to override an existing toolbar template or to use config for customization?
If I use the 1.0.5 gem, I am presented with the file selector button and can opt to upload an image. However, the image upload process fails. I have saved the CORS configuration to the bucket.
If I try using the 1.0.6 gem, I am never even presented with the option of uploading a file.
Any chance you have an idea of what I'm screwing up?
Insert a link to the text.
Switch to the html view.
The link has the rel="nofollow" attribute.
Delete the rel attribute manually.
Save the Text.
Text in the db has no rel="nofollow" attribute.
Open the text again in the Active Admin view.
Switch to html view.
The link has now has a rel="nofollow" attribute again...
Using the active_admin_editor-0.3.6
form do |f|
f.inputs "Post" do
f.input :text, as: :html_editor
end
end
Hosted @ heroku
Is there a config to allow following for every link? Did I missed something? Does heroku convert every link to a nofollow to prevent link farming?
Hi! Can I somehow disable parser_rules?
It's remove all params from div
<div class="bar" style="width: 60%;"></div>
goes to
<div></div>
It seems the editor automatically loads the wysiwyg.css styles on load time, so it's not necessary to require the path in your application.css file as stated in the readme.
Should just set the width
attribute to a percentage value: 100%
, 75%
, 50%
, 25%
Hey,
I'm using your great gem but unfortunately it doesn't seem to work for new nested objects.
This is how I use it in the config file /app/admin/issues.rb:
ActiveAdmin.register Issue do
...
form do |f|
...
f.has_many :topics do |t_f|
...
t_f.input :text, as: :html_editor
...
end
f.actions
end
end
Now, when I click "New Topic", the form appears but text is just a simple textarea. After saving and clicking on edit, the topic and the input text is loaded correctly. I think the JS and whatnot is not correctly loaded because the form is appended after DOM is loaded?
The parser is removing internal links from src and href. The cases I have found look like this:
<img src="/image.png"> => <img alt="">
and
<a href="/file.pdf"> => <a target="_blank"></a>
Tried overriding the parser rules in config/active_admin_editor.rb with:
config.parser_rules['tags']['img'] = { # allows iframes
check_attributes: {
width: 'numbers',
alt: 'alt',
src: 'src', # if you compiled master manually then change this from 'url' to 'src'
height: 'numbers'
}
}
However, this just made the src to be parsed out even if it had http:// in it.
The documentation says internal links are allowed, so I am not sure what the issue is.
The gem is currently unusable, due to a missing mixin, 'box-shadow'.
There is a pull request waiting, #62, that seems to deal with this problem.
Sometimes the 'upload a file' button is there, sometimes it is not there. When you click that button nothing happens, than u reload the page and the image is uploaded 3 times...
rails-3.2.8
activeadmin-0.5.0
last chrome and ff, ubuntu 12.04
I got error when I tried to use it (on Rails 5):
/.rvm/gems/ruby-2.4.0/bundler/gems/activeadmin-6411350c8abf/app/views/active_admin/resource/edit.html.arb where line #2 raised:
Undefined mixin 'box-shadow'.
The image upload button is not showing up on heroku but it is locally. I followed the heroku specific instructions on the doc and s3 is setup and working locally.
It's working locally but can't make it work in heroku. upload button doesn't show up.
I tried
config.assets.initialize_on_precompile = true
and
config.assets.initialize_on_precompile = false
I have all the AWS settings correct (it works locally).
I enabled the heroku lab feature with
heroku labs:enable user-env-compile -a myapp
Can you help please? Thanks.
I have tried use it and appear errors:
Sass::SyntaxError at /admin/articles/new
Undefined mixin 'box-shadow'.
(in /home/pro/.rvm/gems/ruby-2.1.5@etf/gems/active_admin_editor-1.1.0/app/assets/stylesheets/active_admin/editor.css.scss:25)
There is issue in adding mailto on any link rather than adding any url. Email id is get removed from the link and target="_blank" is added.
Because lib/active_admin/editor/engine.rb
calls ActiveAdmin.setup
, which calls Application#register_default_assets
, which unconditionally registers active_admin.js
, I'm getting active_admin.js
loaded twice on my page (first time it's registered in config/initializers/active_admin.rb
).
I'm not sure if I should escalate it upstream to active admin, or if active admin editor should deal with it.
I'd be glad to provide a patch, if you have any suggestions @ejholmes .
Thanks for a great gem!
the terminal seems to suggest things have gone okay:|
Started GET "/admin/image_assets.json" for 127.0.0.1 at 2012-12-05 12:07:08 +0000
Processing by Admin::ImageAssetsController#index as JSON
ImageAsset Load (0.9ms) SELECT `assets`.* FROM `assets` WHERE `assets`.`type` IN
('ImageAsset') ORDER BY `assets`.`id` desc LIMIT 30 OFFSET 0
Completed 200 OK in 118ms (Views: 1.0ms | ActiveRecord: 0.9ms)
but no image is shown in the body of the text.
Could this be related to my app already having an 'assets' table?
Need center position when adding image.
And opportunity to translate gem. I'll translate it to Russian.
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.