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

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

Rails: Too Few Arguments

You forgot to write responds_to block: def update @holder = Holder.find(params[:id]) if @holder.update_attributes(params[:holder]) respond_to do |format| format.html { redirect_to holders_path } #, flash[:success] = “holder updated”) format.js end else render ‘edit’ end end But I am suspicious about your index.html.erb, I don’t think that will really work the way you think.

How to debug a Rails asset precompile which is unbearably slow

This may not entirely answer your question, but I believe it is a decent enough start. As you’ll see, the precise answer will depend on the individual application, gem versions and so on. So. For asset-related work, as you know, Rails uses a library called Sprockets, which in newer versions of Rails is, I believe, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)