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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:53:09+00:00 2026-06-14T21:53:09+00:00

I am trying to execute an AJAX routine with rails the code runs normally

  • 0

I am trying to execute an AJAX routine with rails
the code runs normally but the response doesnt..

I get this error

Template is missing

Missing template line_items/create, application/create with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "D:/ruby/depot/app/views" 

I created the create.js.rjs inside line_items directory like the book Agile Web Development says it is to be, but the error insists..

#file line_items_controller.rb

def create
    @cart = current_cart
    product = Product.find(params[:product_id])
    @line_item = add_product(@cart, product.id)

    respond_to do |format|
       if @line_item.save
        format.html { redirect_to store_url }
        format.js 
        format.json { render json: @line_item, status: :created, location: @line_item }
        #...
      end
    end
  end

and inside my create.js.rjs I got this

page.replace_html('cart', render(@cart))
  • 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-14T21:53:10+00:00Added an answer on June 14, 2026 at 9:53 pm

    Rjs is not a valid format anymore I guess. Use js.erb instead. Also manual you’re following is outdated since none uses prototype anymore.

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

Sidebar

Related Questions

Trying to get the code below to work but the success doesn't execute -
I am trying to execute ajax method from Dialog, but its not getting executed.
I`m trying to execute linux commant 'cat' from java code, but it does not
Im trying to build a form which uses AJAX but its failing to execute
Trying to execute this: function getReport(name) { $.ajax({ type: POST, url: reportAjax.php, data: name=+
I am trying to execute a script in a div tag by AJAX. But
I'm trying to execute a jquery code from a php page called by ajax.
Very new to ruby on rails and trying to get my first ajax call
I'm trying to execute next: $.ajax({ type: 'GET', url: 'http://127.0.0.1:6789/dir', data: , success: function(data)
I'm trying to execute a server side method using this technique: Javascript Ajax function

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.