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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:46:17+00:00 2026-05-26T04:46:17+00:00

i am trying to update a div using form_for :remote => true, but its

  • 0

i am trying to update a div using form_for :remote => true, but its not happening. given below is my code

monhtly_report.html.erb

<%= form_for(:monthly_detail, :url => product_report_monthly_details_path,:remote => true) do |f|%>
<table class="form-table">
<tr>
  <td width="80px">
    Product
  </td>
  <td colspan="2">
    <%= f.collection_select(:product_id, @products, :id,:name, :prompt => true)%>
  </td>
</tr>
<tr>
  <td>
    Month
  </td>
  <td>
    <%= select_month(Date.today, :field_name => 'selected_month') %>
    <%= select_year(Date.today, :start_year => 2000, :end_year => 2020, :field_name =>'selected_year') %>
  </td>
</tr>
<tr>
  <td></td>
  <td>
    <%=submit_button_tag 'Submit'%>
  </td>
</tr>
</table>
<%end%>
<div class="monthlyreportsection">

</div>

and this is my controller

  def product_report
    @details = MonthlyDetail.find_by_product_id(params[:monthly_detail][:product_id].to_i)
    @time = Date.new(params[:date][:selected_year].to_i, params[:date][:selected_month].to_i,1)
    respond_to do |format|
      format.js
    end
  end

P.S : the request is going to controller as html whereas it has to be JS

the product_report.js.erb

$("#monthlyreportsection").html("<%=escape_javascript(render(:partial => "product_details"))%>")

My actual problem is the div is not getting uploaded. help me out. Thanks in advance.

  • 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-26T04:46:18+00:00Added an answer on May 26, 2026 at 4:46 am

    finally i fixed it.

    though i was using jquery i had not updated the “rails.js” file, it was still using prototype’s “rails.js” file. so the div was not getting updated.

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

Sidebar

Related Questions

I'm using codeigniter and trying to do an UPDATE query, but it keeps creating
Hi I am trying to update a div with some html from another div.
I trying to update a model on a callback but the validation is causing
I'm trying to update a hashtable in a loop but getting an error: System.InvalidOperationException:
So I'm trying to update an object in my MS SQL 2005 database using
I'm trying to update an NText field in SQL 2000 using Classic ASP. Here
I am trying to update a KnockOutJS page using an Ajax call. The Update
I'm trying to figure out how to select the textarea in the code below
I am trying to update a div on a form based on user input
I'm using the following code in my HTML form - trying to make 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.