Uploading a remote file url from Rails Console with Carrierwave

Take a look at the ‘Uploading files from a remote location‘ section on this page https://github.com/carrierwaveuploader/carrierwave CarrierWave should throw an error if the url of the location is invalid 2.1.3 :015 > image.remote_image_url = “http” => “http” 2.1.3 :016 > image.save! (0.2ms) BEGIN (0.2ms) ROLLBACK ActiveRecord::RecordInvalid: Validation failed: Image trying to download a file which … Read more

The use of :alert (or :notice) with the render method, from the Ruby On Rails guide called ‘Layouts and Rendering in Rails’, does not work for me:

I’m confused as to why that Rails Guide mentions using flash values in render, since they only appear to work in redirect_to at the moment. I think you’ll find your approach works if you put a flash.now[:alert] = ‘Alert message!’ before your render method call. Edit: this is a flaw in the guides that will … Read more

ArgumentError (too few arguments): when calling format.json on rails 4.04

Mostly you would get the error ArgumentError (too few arguments): on the format when you forget to call this part of code within the block to respond_to method call. Your code should actually look like def action_name respond_to do |format| ## Add this format.json { render json: {}, status: :ok} format.html ## Other format end … Read more

Gem Vs Plugin Vs Engine in Ruby on Rails

Plugins as you knew them from Rails 2 (i.e. plugins under the vendor/plugins folder) were deprecated for Rails 3.2; support for it was completely removed in Rails 4. Now, there’s a concept of a “gamified plugin” where the plugins are essentially built as gems and can be shared across different Rails applications. But to answer … Read more

TinyMCE 4 links plugin modal in not editable

From https://github.com/tinymce/tinymce/issues/782 For jQuery UI dialogs you can do this: $.widget(“ui.dialog”, $.ui.dialog, { _allowInteraction: function(event) { return !!$(event.target).closest(“.mce-container”).length || this._super( event ); } }); This seems to be a more generalized solution that you might be able to modify for Bootstrap: $(document).on(‘focusin’, function(e) { if ($(e.target).closest(“.mce-window”).length) { e.stopImmediatePropagation(); } }); Update: For the new version … Read more