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

  • Home
  • SEARCH
  • 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 6862605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:40:53+00:00 2026-05-27T02:40:53+00:00

I am running into a stranger error in Internet Explorer. I have a form_for

  • 0

I am running into a stranger error in Internet Explorer.

I have a form_for with remote => true.

In turn, when the create action is called there is an associated create.js.erb file.

When I hit submit it IE the browser askes me to download the returned create.js.erb file.

This only occurs when I tried to upload an image in the form.

I do not understand what the problem is.

The form works in Firefox and Chrome.

I am using remotipart for the image upload (not sure if that helps).

In addition, I am using paperclip for the image attachments.

Below I will post my view, controller, and create.js.erb.

View:

 <% form_for @post, :remote => true, :html => {:multipart => true} do |f| %>
                        <%= f.text_area :message, :value => "What's up?" %>
                        <div id="newPostBottom">
                            <div id="newPostBottomRight">
                                <div id="loading">
                                    Sharing <%= image_tag('spinner.gif') %>
                                </div>
                                <%= f.submit "Share", :class => 'button' %>
                            </div>
                            <div id="newPostBottomLeft">
                                <%= f.label :channel, "Select Channel:" %><%= f.select :channel, channels, :prompt => "Choose..." %>
                                <div id="postImageUpload">
                                    <%= image_tag('icons/camera.png', :id => 'postUploadImageIcon', :alt => 'Upload Image', :title => 'Upload Image') %>
                                </div>
                                <%= f.file_field :post_image %>
                            </div>
                        </div>
                    <% end %>

Controller:

 def create
account = Account.getAccountById(session[:user])
@post = account.posts.build(params[:post])

payload = {
    "account_id" => account.id,
    "name" => account.name,
    "message" => params[:post][:message],
    "channel" => params[:post][:channel]
}
if @post.save
    Pusher['front-post-feed-channel'].trigger('front-post-feed-create', payload)
else
    render :nothing => true
end

 rescue ActiveRecord::RecordNotFound
 reset_session
 end

Create.js.erb:

 $("#post_message").val("What's up?");
 $("#post_message").css({height: '30px'});
 $("#newPostBottom").hide();
 $("#postsHomeFeed").prepend("<%= escape_javascript(render(:partial => '/posts/new_post', :locals => {:post => @post})) %>");
 $("#loading").hide();
 $("#post_submit").show();
 $("#post_channel").val('');
 $("#post_post_image").val('');
 if($(".noContent").length > 0) {
$(".noContent").remove();
 }

Appreciate any help.

Thanks,

Brian

  • 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-05-27T02:40:54+00:00Added an answer on May 27, 2026 at 2:40 am

    Try wrapping the contents of your create.js.erb file in a remotipart_response block:

    <%= remotipart_response do %>
      $("#post_message").val("What's up?");
      $("#post_message").css({height: '30px'});
      $("#newPostBottom").hide();
      $("#postsHomeFeed").prepend("<%= escape_javascript(render(:partial => '/posts/new_post', :locals => {:post => @post})) %>");
      $("#loading").hide();
      $("#post_submit").show();
      $("#post_channel").val('');
      $("#post_post_image").val('');
      if($(".noContent").length > 0) {
        $(".noContent").remove();
      }
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running into a problem where on certain servers we get an error that the
Running into a problem. I have a table defined to hold the values of
I'm running into an issue where I have a FileUpload control in an UpdatePanel.
I'm running into a rather strange GLSL compilation error while using Intel HD Graphics
I'm working with JQuery and i'm running into this strange (or perhaps stupid) error.
I have a navigation controller based application and I'm running into a strange issue
I'm running into a strange error - I'm exporting an Android application in Eclipse
I have run into a very strange scenario. There is a .resx file in
I'm running into a very strange error in Firefox and Chrome. The error doesn't
Hey there! I'm trying to serialize data in AS3 but am running into a

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.