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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:06:36+00:00 2026-06-06T09:06:36+00:00

I would like to send a javascript array to be processed by a method

  • 0

I would like to send a javascript array to be processed by a method in my controller.
I think I am doing this way wrong. I am a total RoR, jquery, and ajax noobie. Here is what I have. Please give me some guidelines:

<div id="dataTable" class="dataTable" style="width: 680px;height: 300px; overflow: scroll"></div>
<button>Save!</button>
<script>
    var first = true;
    var totalChanges = new Array();
    $("#dataTable").handsontable({
         //...some code that generates appropriate array totalChanges
    });
    var data = //..some code
    $("#dataTable").handsontable("loadData", data);
    $(function() {
            $( "button").button();
            $( "button" ).click(function() { 
                    alert("clicked"); 
                    $.ajax({
                            type: "POST",
                            url: "save",
                            data: JSON.stringify(totalChanges),
                            success: function() { alert("Success!"); }
                    });
            });
    });

</script>

I get this error:

POST http://10.10.136.244:6500/qtl_table/save 500 (Internal Server Error) 

and

Started POST "/qtl_table/save" for 10.64.229.59 at Mon Jun 25 16:58:46 -0500 2012
  Processing by QtlTableController#save as 
  Parameters: {"125,0,\"\",\"Ph upt 1-2\""=>{","=>{"125,1,\"\",\"DOR364\""=>{","=>{"125,2,\"\",\"G19833\""=>nil}}}}}
LOGGER WORKS
Completed 500 Internal Server Error in 81ms

ActionView::MissingTemplate (Missing template qtl_table/save with {:formats=>[:html], :handlers=>[:rjs, :rhtml, :erb, :rxml, :builder], :locale=>[:en, :en]} in view paths "/usr/home/benjamin/phavubase/qtl/app/views", "/usr/home/benjamin/phavubase/qtl/ruby/1.8/gems/declarative_authorization-0.5.5/app/views", "/usr/home/benjamin/phavubase/qtl/ruby/1.8/gems/devise_cas_authenticatable-1.1.1/app/views", "/usr/home/benjamin/phavubase/qtl/ruby/1.8/gems/devise-1.2.1/app/views", "/usr/home/benjamin/phavubase/qtl/ruby/1.8/gems/kaminari-0.12.4/app/views"):
  app/controllers/qtl_table_controller.rb:18:in `data'
  app/controllers/qtl_table_controller.rb:25:in `save'

Rendered ruby/1.8/gems/actionpack-3.0.8/lib/action_dispatch/middleware/templates/rescues/missing_template.erb within rescues/layout (0.8ms)

EDIT:
app/controllers/qtl_table_controller.rb

...
  def save
    logger.debug "\nLOOK! WE SAVED! #{params[data]}\n"
    render "index"
  end
...

I added render :layout => false but I am still getting the missing template error. Also, someone suggested I just begin adding logic to my controller but the data parameter looks really funky. Its supposed to be an array of arrays that I turned into a string. Could you guys give me some more help?

  • 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-06T09:06:38+00:00Added an answer on June 6, 2026 at 9:06 am

    You should either create a template in app/views/qtl_table/save.html.erb or render something in your controller. If nothing is rendered in the controller action, Rails tries to display default template, and you don’t have one.

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

Sidebar

Related Questions

I would like to have a way to specify for certain Javascript method which
I would like to send a html string with a GET request like this
I would like to write a javascript function that works something like this... f([[a]],
I would like to send some javascript from one file to another in my
I would like to send the message from HelloWorldLayer, and receive it in ScoreLayer,
I would like to send and receive OpenSoundControl in an AIR application, on the
I would like to send a list of Appointment s through WCF. My Interface
I would like to send out an update of my apk, but i did
I would like to send a struct from my client program to a server
I have completed my program and would like to send that program in its

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.