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 8694461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:47:42+00:00 2026-06-13T00:47:42+00:00

I have inside a fancybox box this form: <%= simple_form_for(@message, :remote => true, :html

  • 0

I have inside a fancybox box this form:

<%= simple_form_for(@message, :remote => true, :html => {:multipart => true}, :url => { :controller => "users/messages", :action => "create"} ) do |f| %>
 <%= f.error_notification %>
 <%= f.input :subject, :input_html => { :maxlength => 500} %>
 <%= f.input :message_image, :as => :file %>
 <%= f.button :submit, t('.send_message'), :class => 'btn-large btn-primary', "data-disable-with" => t('.send_message'), :confirm => t('.sure_send_message') %>
<% end %>

This is my create action:

def create
 @message = Message.new(params[:message])
 respond_to do |format|
  if @message.save
   format.js { render :partial => "users/messages/templates/sent_by_user/create" }
  else
   format.js { render :partial => "users/messages/templates/sent_by_user/nosave" }
  end
 end 
end

The files create.js.erb or nosave.js.erb file is working fine if I don’t try upload a image

If I try upload a image this files is not rendered.

However in my log I can see:

Processing by Users::MessagesController#create as JS
  Parameters: {"message"=>{"message_image"=>#<ActionDispatch::Http::UploadedFile:0xf7a85c8 @original_filename="cara_enfadada.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"message[message_image]\"; filename=\"cara_enfadada.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20121015-21710-6oxtn2>>, "subject"=>"estrella de neutronessssssssssss"}, "commit"=>"Enviar mensaje", "utf8"=>"✓", "authenticity_token"=>"mfSsl0HafWoW86YiO2Hj7zMepAITZlHHBtUqW0wzubU=", "remotipart_submitted"=>"true", "X-Requested-With"=>"IFrame", "X-Http-Accept"=>"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01", "locale"=>"es"}

and

Rendered users/messages/templates/sent_by_user/_nosave.js.erb (0.2ms)
Completed 200 OK in 498ms (Views: 1.5ms | Solr: 0.0ms)

On google chrome console I get the next alert:

Resource interpreted as Document but transferred with MIME type text/javascript:

I’m using remotipart gem but I dont find the error…
Where is the error?
Thank you

  • 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-13T00:47:44+00:00Added an answer on June 13, 2026 at 12:47 am

    I will never execute the js.erb because one can just directly upload a file(image in your case) using ajax

    You might want to think of remotipart or pupload or jqueryfile_upload or uplodify to acheive

    I’m sure that remotipart use iframe

    Pupload use runtime support html5 or flash

    uploadify use flash

    not sure of jqueryfile_upload as never tried it

    Good luck

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

Sidebar

Related Questions

I have a problem. I have form inside a fancybox. This form have a
I have inside a fancybox box is already opened the next link: <%= link_to
I have put fancybox (jquery plugin ) inside the assets/javascripts/includes/jquery.fancybox-1.3.4 Before this location i
I have a link on my page, which calls a login form inside Fancybox.
I have a form inside a fancybox. The form is submitted with ajax. Is
I have this inside a usercontrol in my aspx: <asp:TextBox TextMode=MultiLine onkeydown=textCounterLatest('<%=txtContent.ClientID%>' , '<%=remLen.ClientID
I have this inside my DAO public String CSNSurvey() { StringBuilder mailstr = new
I have this inside my spring xml file: <object type=Test.Web.Utilities.TestClass, Test.Web singleton=false id=TestClass> <property
So I have a javascript library setup on http://www.topholidayrecipes.com/crockpot-chicken-recipes.html and this page uses fancy
I have an unordered list: <ul> <li><a id=fancy_popup href=popup.html class=fancybox> Popup HTML Link</a></li> <li><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.