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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:09:12+00:00 2026-05-31T17:09:12+00:00

I am a newbie at Javascript, JQuery, and to a lesser extent, Rails. I

  • 0

I am a newbie at Javascript, JQuery, and to a lesser extent, Rails. I trying to add some interactive behavior to my existing Rails app but for now am just trying to get it to render the following test:

myteams.js.erb:

page.alert('Hi')

My controller includes the following:

def myteams

    if (params[:command] == "accept")
      invite = TeamUser.find(params[:id])
      invite.confirmed = true
      invite.save
    end

    if (params[:command] == "delete")
      invite = TeamUser.find(params[:id])
      invite.destroy
      @teams = current_user.teams
    end

    respond_to do |format|
      format.html 
      format.js
      format.json { head :ok }
    end
  end

The link that calls the code in myteams.html.erb:

<%=link_to image_tag("delete.png"), {:controller => "teams", :action => "myteams", :id => teamAssociation.id, :command => "delete"}, :class => "deleteTeam", :remote => :true %>

and my application.js includes:

jQuery.ajaxSetup({ 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} })

When I click the link, the team is deleted from the database but nothing happens on screen – no reload, no alert prompt. I am loading the jQuery files in application.html.erb. I have no idea why this simple test is not working. Please help and thank you 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-31T17:09:13+00:00Added an answer on May 31, 2026 at 5:09 pm

    Try doing simply
    alert('Hi') in myteams.js.erb

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

Sidebar

Related Questions

I'm a jQuery newbie and for now I rely on modifying existing scripts, but
I'm javascript newbie...please bear with me. Modified some jQuery animation code from w3c tutorial.
I am a total newbie to JavaScript and jQuery, and need some help. Also
I'm new to jQuery and to some extent JavaScript programming. I've successfully started to
I'm a total newbie and want to start with php. I know some javascript
I'm a total newbie when it comes to Javascript/jQuery so hopefully you can help
Being a newbie to Javascript and jQuery, I am not sure whether this is
I'm newbie to jQuery (I came to JavaScript from PHP). I grouped multiple jQ
I'm totally newbie in javascript/jQuery and i have a little problem :) I'm using
I am web-designer, not a programmer and a newbie in Javascript / jQuery (although

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.