I was following the guide I found online to put ActiveAdmin and TinyMCE together into use, but I encountered a strange error which I was not able to search up the solution for it.
One part of it was to add in this line to config/initializers/active_admin.rb:
config.register_javascript 'tinymce.js'
However, when I try to run the app, an error says:
/Users/RageBill/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-5ebf476abd92/lib/active_admin/application.rb:49:in method_missing': undefined methodregister_javascript' for # (NoMethodError)
Any thoughts on how can I resolve this problem? Thank you very much :)
(P.S. my rails version is 5.1.3 if that would be helpful.)
I found:
https://github.com/activeadmin/activeadmin/issues/340
This sholud work:
ActiveAdmin.setup do |config|
config.register_stylesheet "//cdn.foo.net/example.css"
config.register_javascript "//cdn.foo.net/example.js"
# ...
end
Related
I'm trying to set up Oauth with this rails project, but everytime I click 'login with ...' in my view, it renders an undefined method error for 'login_at'. My Sorcery config file contains the specific external submodule
Rails.application.config.sorcery.submodules = [:remember_me, :external]
but I still can't get past that error, any help would be greatly appreciated
You also have to provide external providers to sorcery config, e.g.
Rails.application.config.sorcery.configure do |config|
...
config.external_providers = [:twitter, :facebook]
...
end
Am trying enable offline mode for my Rails apps by following the Offline Apps Railcast in the below URL
http://railscasts.com/episodes/247-offline-apps-part-1
Made the following changes to my app
Added gem 'rack-offline' to gemfile
Added match "/application.manifest" => Rails::offline to routes.rb
Updated HTML tag to in application.html.erb
Added ENV["RAILS_ASSET_ID"] = "" to application.rb
When trying to start rails server it throws the following error
undefined method `offline' for Rails:Module (NoMethodError)
Any help appreciated
The syntax should be:
Rails::Offline
I am integrating Postmark's transactional email service into my web application so that when a user signs up, my application sends the user a welcome email. When I try to signup as a user, I get the following error: undefined method `postmark_settings=' for ActionMailer::Base:Class
In my config/application.rb file, I have the following code:
config.action_mailer.delivery_method = :postmark
config.action_mailer.postmark_settings = { :api_key => "my_api_key" }
I'm not sure what is causing the error or how I can go about fixing it. If I haven't provided enough useful information to solve the problem, just let me know and I'll add whatever code might be useful. Thanks so much!
Have you included the line below in your Gemfile?
gem 'postmark-rails', '0.4.0'
There are similar issues where people haven't included this line on the Gemfile...
Also, are you using Rails 3? The configuration in different between Rails 2 and 3. Please note details here.
NOTE: ORIGINAL PROBLEM WAS FIXED, but there's still some issues using the plugin on rails 3.0.3 with ruby 1.8.7, the maintainers have been notified of this. Thanks for everyone's help.
Hi All, I am using the plugin located at https://github.com/galdomedia/tinymce_filemanager
and i have followed the instructions, and the editor does load.
However I am getting the following error when trying to insert an image and use the file browser.
Unknown action
The action 'tinymce_filemanager' could not be found for PagesController
Is this something someone has come across before?
In my controller for pages I have included the following before my methods
include TinymceFilemanager
which is what it said in the instructions.
BTW I am using rails 3.0.3 and ruby 1.9.2
Any help would be greatly appreciated.
Cheers,
Matenia
2nd January 2010 - Update
I have worked out how to avoid this error ... comment out the
# match ':controller(/:action(/:id(.:format)))'
this is due to tinymce_filemanager declaring it's routes after the initial application routes have been loaded and it is trying to match the controller and actions on the above line instead of moving forward.
Now I have a new issue:
NoMethodError in PagesController#tinymce_filemanager_upload_image
undefined method `type' for #<ActionDispatch::Http::UploadedFile:0x00000101ac45e8>
it's saying that the error is in
vendor/plugins/tinymce_filemanager/lib/galdomedia/tinymce_filemanager.rb:249:in upload_base'
vendor/plugins/tinymce_filemanager/lib/galdomedia/tinymce_filemanager.rb:123:intinymce_filemanager_upload_image'
which is (method on line 123)
def tinymce_filemanager_upload_image
upload_base(images_folder, "tinymce_filemanager/list_images", accept_image_mime, image_size_limit)
end
and method on line 249
see: https://github.com/galdomedia/tinymce_filemanager/blob/rails3/lib/galdomedia/tinymce_filemanager.rb#L243
it seems to not find file.type ... hhhmmm ....
going to also try cloning another repo that seems to be using this plugin in a CMS to see where I have gone wrong.
Thank you so far to the stackoverflow community.
Cheers, Matenia
For Rails 3 it looks like the include module is include Galdomedia::TinymceFilemanager, not include TinymceFilemanager, are you using the rails3 branch?
See comments below
When i include fb_connect_async_js javascript helper it is throwing an
error , Facebooker 2 don't have action view template. Could you please tell
me how handle this situation .
undefined local variable or method `fb_connect_async_js' for
ActionView::Base
Thanks,
Srini
try add require 'facebooker2' in environment.rb and rake gems:install