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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:31:18+00:00 2026-05-23T18:31:18+00:00

I am trying to modify a code in Javascript. My application is written is

  • 0

I am trying to modify a code in Javascript. My application is written is Ruby rails and Javascript. It is run in Heroku. I have been modifiying everything in Notepadd++, then I saved it, push it into heroku and then I see the results.

The problem comes when I want to change something in Javascript. I have been making changes in a file called quote.js but when I change something, nothing happens. Below you can see the code I am trying to change. I this case I am just trying to take out a column called items from the labour summary table, I removed it from the variable dest and I put it in comments in labour summary.

It seems that the changes I make here have not any effect on the whole application. Am I modifying the wrong file?

Is this the right way to modify the javascript code in Ruby rails?

Thanks.

var labour_summary = $(labour_line_items).inject({}, function(sum){
            var key = this.pieceIdentifier();
            var added = this.pieceSummary();
            if(typeof sum[key] == 'undefined') {
                // New material in summary
                sum[key] = added;
            } else {
                // Add quantity to summary
                sum[key].hours  += added.hours;
                sum[key].cost   += added.cost;
                //sum[key].item += ", " + added.item;
            }
            return sum;
        });


        var dest = this.labour_summary_table;
        $("tr:gt(0)", dest).remove();
        $.each(labour_summary, function() {
            dest.append("<tr><td>" + [$.round_two(this.hours), $.dollars(this.hourly_rate), $.dollars(this.cost)].join("</td><td>") + "</td></tr>");
        });
    },
    updateCustomSummary: function(e) {
        var custom_line_items = this.activeQuoteItems().inject([], function(is) { 
                return $.merge(is, $(this).obj().activeCustomLineItems().get()); // grab this quote items labour line items
            }).collect( function() {    
                return $(this).obj();                                       // extend the array and collect the labour line item objects
            });

        var custom_summary = $(custom_line_items).inject({}, function(sum){
            var key = this.pieceIdentifier();
            var added = this.pieceSummary();
            if(typeof sum[key] == 'undefined') {
                // New material in summary
                sum[key] = added;
            } else {
                // Add quantity to summary
                sum[key].quantity   += added.quantity;
                sum[key].cost       += added.cost;
                //sum[key].item     += ", " + added.item;
            }
            return sum;
        });

        var dest = this.custom_summary_table;
        $("tr:gt(0)", dest).remove();
        $.each(custom_summary, function() {
            dest.append("<tr><td>" + [this.customName, this.quantity, $.dollars(this.costPerPiece), $.dollars(this.cost), this.item].join("</td><td>") + "</td></tr>");
        });
    }
});
  • 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-23T18:31:19+00:00Added an answer on May 23, 2026 at 6:31 pm

    Check if you are including the javascript file quote.js on the page you are trying to load.(Use firebug addon for firefox under net tab or script tab to check if the file is loaded or not). You need to include javascript in your layout.

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

Sidebar

Related Questions

I've been trying to modify the AuditTrail code so that it does not copy
I'm trying to modify a code not written by me, so I want to
I'm struggling with trying to modify some Javascript code. I know what I want
I have been trying everything I can to get this script to work and
I'm trying to modify the code from this script . Basically I'm trying to
I keep getting this error while trying to modify some tables. Here's my code:
i've dev code for wifi scanning in python, now i trying to modify my
I'm trying to understand code that I bought so I can modify it. In
I'm trying to determine how to modify SAP R/3 package code of an installed
I'm trying to find some javascript code that I can embed on my website

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.