Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:22:00+00:00 2026-06-01T20:22:00+00:00

Rails 3.1, ActiveRecord, JQuery I am using Carrierwave to upload an image to a

  • 0

Rails 3.1, ActiveRecord, JQuery

I am using Carrierwave to upload an image to a model using AWS S3. Very simple just one image per model. I want to use Uploadify with it.

It works fine without Uploadify, but with it I get the error:

NoMethodError (undefined method `has_key?' for #<ImageUploader:0x00000103c7f2f0>):

The code for the uploader works on its own and I’ve followed this post to try to get Uploadify to work. And then I used this code to get the CSRF issue taken care of.

The code to set up Uploadify in the edit.html.erb is:

<% content_for :head do %>
  <%= javascript_include_tag 'jquery.uploadify.v2.1.4.min' %>
  <%= javascript_include_tag 'swfobject' %>
<% end %>
<%= content_for :scripts do %>
  <script type="text/javascript">
  <% session_key_name = Rails.application.config.session_options[:key] %>
    jQuery('input#facility_image').uploadify({
      'uploader'     : '/assets/uploadify.swf',
      'script'       : '<%=facilities_path%>',
      'fileDataName' : 'facility[image]',
      'fileExt'      : '*.png;*.jpg;*.gif',
      'cancelImg'    : '/assets/cancel.png',
      'multi'        : false,
      'scriptData'   :  {
           '_http_accept': 'application/javascript',
           '<%= session_key_name %>' : encodeURIComponent('<%= u cookies[session_key_name] %>'),
           'authenticity_token': encodeURIComponent('<%= u form_authenticity_token %>'),
        },
      'auto'         : true,
      'buttonText'   : 'Upload Image',
      'onComplete'   : function(e, id, obj, response, data) {
        $('#images').append(response);
      }
    });
  </script>
<% end%>

Anyone know why this error is happening and/or how to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:22:02+00:00Added an answer on June 1, 2026 at 8:22 pm

    If you are using devise, this is a better fix http://ariejan.net/2011/03/27/rails-3-devise-uploadify-no-flash-session-hacks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery-rails-autocomplete and want to have autocomplete on more than one column.
I need to upload an image from a rails form using Ajax and convert
Using Rails ActiveRecord, am wanting to calculate the time between two datetime fields within
I've added a before_create filter to one of my Rails ActiveRecord models and inside
I'm trying to convert an ActiveRecord model to JSON in Rails, and while the
I'm looking for a rails plugin/gem which brings the functionality of marking an ActiveRecord-Model
I'm new to Rails, so forgive my ignorance of ActiveRecord. One of my models
Using: jquery3-autocomplete gem at 1.0.5 jquery-rails gem at 1.0.19 mysql2 gem at 0.2.7 The
I have a very standard CRUD app in Rails & Jquery Mobile with two
I'm having problems in uploading a file using Rails and jQuery, I'm using attachment_fu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.