My CkEditor not looking good in Active Admin - ruby-on-rails

My CkEditor look like see image
Can you help me please...
I want to display ckeditor like on http://ckeditor.com/demo
This issue is in active admin. I want to use ckeditor on active admin.
My Active Admin version is = 0.6.0

This issue is related to a change in Active Admin CSS style described in this issue:
https://github.com/gregbell/active_admin/issues/1852
There is also a pull request awaiting merging: https://github.com/gregbell/active_admin/pull/1952
For temporary fix i'm using my cloned version with this diff applied:
gem 'activeadmin', :git => "git#github.com:kars7e/active_admin.git"
The offending CSS is the reset style which unfortunately has higher importance than CKEditor styles.
EDIT:
The maintainers of original repo have merged the fix and it's working correctly.

probably something is missing, try inspect element( chrome browser) and reload the page,see if there is some error where something is not loaded because you got the thing, just styling is incorrect.

Had the same issue, code in following wiki page helped a little....
https://github.com/gregbell/active_admin/wiki/Ckeditor-integration

You can use this fix: https://gist.github.com/SebAshton/4690552 (it worked well for me)

Related

Rails edit gem in production

I am trying to edit a specific gem:
https://github.com/rderoldan1/md_simple_editor
The issue is that the editor does not load without a page refresh first.
The issue can be checked here: https://github.com/rderoldan1/md_simple_editor/issues/9
I was able to fix this in my local by editing the file:
/usr/local/rvm/gems/ruby-2.3.4/gems/md_simple_editor-0.3.0/app/assets/javascripts/md_simple_editor.js.coffee
It is fixed by just editing the code as the other users are saying in the issue posted in the gem url above.
I cant find the right place to fix this in production, can someone point me in the right directory path?
Thanks in advance.
Don't do it that way. Fork the gem, make the changes in the gem code and make sure you write tests that prove your code works as expected. Then push the code to your forked repo on github.
Then make a pull request and support the open source community. In the mean time, you can use your version of the gem by edit your Gemfile like so:
gem 'md_simple_editor', github: 'lacostenycoder/md_simple_editor', branch: 'master'
Of course replace lacostenycoder with your github username.

refinerycms iframe dont show in my webpage

My webpages don't show any iframe or embed html code. The wymeditor preview show the page perfectly, the information is stored on the database, but the page show nothing. I'm using Rails 4.2.6 and the newest refinerycms version.
I've tried everything, this guy had the same problem https://github.com/refinery/refinerycms/issues/1991 but the solution didn't work for me.
I think the reason the fix doesn't work anymore is because of the deprecation of the allowed_tags/allowed_attributes settings. See info on that here
However, if you trust the content, you could just skip the sanitization process altogether by overriding the default template.
bundle exec rake refinery:override view=refinery/pages/*
That will dump a couple of views into your project. Change the show template to something like this to render without sanitizing:
<%= raw(#page.content_for(:body) %>
We sanitize the SectionPresenter since Refinery CMS 3.0.2 and we are aware of whitelist problems, there is a pending pull request to help devs to add more tags in your whitelist like probably iframe.
Please test this pull request to see if it fixed your problem : https://github.com/refinery/refinerycms/pull/3164

Rails 4.2 + Ember => unexpected identifier

I'm following Vic Ramon's tutorial. I tried to use the latest version of Rails and Ember-source and I get the following error when visiting home page:
After clicking on link next to error I get this:
How can I fix that?
I ran the following commands:
rails g ember:bootstrap -n App --javascript-engine coffee
rails g ember:install
I removed turbolinks. I also created home controller and an empty view for home#index. Root is set to home#index. Also created following view file:
// app/assets/javascripts/templates/application.js.emblem
h1 Hello World
outlet
Ember gems im using:
Using emblem-source 0.3.18
Using ember-data-source 1.0.0.beta.14.1
Using ember-rails 0.16.1
Using emblem-rails 0.2.2
This could be due to some version incompatibilities between your versions of ember-related gems, as there were quite substantial changes in recent versions of ember (e.g. introduction of HTMLBars, etc.)
Your best bet is to clone the original repo and then try to upgrade individual gems and check if it still works after each upgrade. This way you will be able to identify the troubling gem.
I have verified that the original repo code indeed works with the versions of gems in its current Gemfile.lock.
If you are starting a new Rails + Ember app, ember-cli-rails is probably the way to go, giving you the best of both worlds.
Emblem was the culprit. Replacing .emblem with .handlebars fixed the problem. I tried the tip from emblem-rails git page and icluded
gem "emblem-source", github: "machty/emblem.js"
but that didn't change anything.
I also followed this tutorial (alongside a few others) and I encountered several issues alongside the way ranging from handling templates to setting up the JSON API. I don't see your entire source code so I cannot pinpoint the exact problem. However, it seems that we have similar projects, so you can compare your code to my blog project source code and see what is causing these issues. Comparing to Ramon's tutorial, my blog has implemented everything until chapter 15.
https://github.com/Deovandski/Fakktion/tree/Ember-Rails
If you are a beginner like myself, then I recommend avoiding CoffeeScript and Emblem and sticking to Javascript as much as possible for the first months because you will find more resources and examples. Also, let me know if you need assistance in setting up the project as I used .gitignore to hide things like secrets.yml

How to install latest official refinerycms-calendar 2.0.2 in RefineryCMS 2.1.1

I have been eating my nails the whole weekend to figure out the right combination of modifications to the official refinerycms-calendar in order to make it work with RefineryCMS 2.1.1.
Here are my conclusions and efforts, hoping that someone will drive me to the right direction:
Adding just gem 'refinerycms-calendar', '~>2.0.0'
as suggested in the github page is not working out of the box. You need to correct the dependencies on the .gemspec file. There are many forks out there created only for this correction.
So, I forked the refinery/refinerycms-calendar project, corrected the dependencies and used my fork in the Gemfile.
Backend (BE) works fine: Created an event, went back to FrontEnd (FE), got a "This page is NOT live for viewing"
This frontend (FE) inconcistency is corrected to the BE > Pages > Venues page: /calendar/venues is not an existing route and needs to be corrected to /calendar/events. The seeds.rb needs to be corrected for a permanent solution.
Go back to FE, now the /calendar/events is blank! I only get the title of the Page as defined on the relative Pages page.
A look on the rails server log reveals that there is a :find_page error resulting form the fact that the refinerycms-events.css under the engine's public/stylesheets folder is neither picked up nor referenced correctly inside show.hrml.erb and index.html.erb files. I copied the refinerycms-events.css under vendor/stylesheets and changed the reference to refinerycms-events.css accordingly.
Refreshed FE but still there is a blank page both when getting /calendar/events and /calendar/events/#{event}
NOTE: If I "rake routes" I can see that the routes for the FE portion are repeated 3 times. I am not quite sure for this behavior, but when I substituted "Refinery::Core::Engine.routes.append do".gsub("append","draw"), I could only see them once.
I have tried many forks around and all of those seem to demonstrate the same behavior.
Can anybody please let me know:
a. If you finally managed to have this (official refinery release) engine fully functional in your projects and if yes which branch was used and with which exact Refinerycms and refinerycms-calendar version combination.
b. If used used a fork rather than the official refinerycms-calendar release, then which fork/branch is that.
I hope someone to have that nailed down.
Best regards,
Petros
Well, seems that changing :body_content_left and :body_content_right with :body and :side_body respectively inside the Engine's show and index views, solves the issue of the /calendar/events and /calendar/events/:event FE pages being blank.
I am still unsure why this is causing such an issue and it is kind of weird nobody to have reported it until now.

Which datetime picker just works with active admin 0.5.0

I am seeking for tested date & time picker that just works with active admin 0.5.0.
I am digging for hours now, I've read dozens of existing discussions on stackoverflow and many other resources found in the net.
I've encountered problems with virtually any datetime picker script. For instance, activeadmin's wiki page Combine datetime picker with active_admin no longer apply to 0.5.0. Result looks like this.
Some of them suffer from CSS inheritance - active admin applies a lot of styling, and if picker's author had not avoided that, it requires manually styling indefinite amount of CSS properties just to revert changes.
I cannot rely on such scripts. It is not because I am lazy, or I am unable to fix them. There's just too big risk of breaking such hacks in case of updating any of dependent gems/libraries related to active admin.
Anyone can recommend working solution that won't suffer from such problems?
I've just created a gem for that:
https://github.com/saepia/just-datetime-picker
Checkout the DateNTimePickerActiveAdmin Rubygem. It works really well and is customisable according to your project.
You can find the documentation here: https://github.com/NikhithaGraceJosh/date_n_time_picker_activeadmin
From the docs:
Gemfile
gem 'date_n_time_picker_activeadmin'
Code Sample (In your form)
f.input :column_name, as: :datetimepicker
CSS
In active_admin.scss, add the line,
#import date_n_time_picker_activeadmin
JS
In active_admin.js, add the line,
//= require date_n_time_picker_activeadmin
Hope it's useful!
just-datetime-picker gem doesn't seem to be maintained since last year, so better to use pickadate-rails gem.
Checkout this Integrating datepicker and timepicker with active admin

Resources