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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:35:33+00:00 2026-05-21T09:35:33+00:00

Total newb here so please don’t assume that I know anything :) I’m trying

  • 0

Total newb here so please don’t assume that I know anything 🙂

I’m trying to create a page for teams that will allow you to perform a couple of different tasks. What I would like to do is create a link on the page for each task and then swap out the partial in the center of the page so that the user can perform that task.

So, in my show.html.erb page I have a link like this:

<a href="#" id="add_team_mate">Add a Team Mate</a>

and a div like this:

<div id="team_action">

In application.js, I have a function like this:

jQuery(function($){
    $("#add_team_mate").click(function() {
            alert("Hello world!");
            return false;
        });
});

which is just a placeholder until I can figure out how to swap out the content in <div id=team_action"> with an appropriate partial. Any help or pointers to jQuery documentation or tutorials would be greatly appreciated.

Thanks!

  • 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-21T09:35:33+00:00Added an answer on May 21, 2026 at 9:35 am

    I’d do something like jQuery("#team_action").empty().append(<new partial html goes here>);. you’d get the partial from an ajax rendered view? Sorry I’m not versed in ruby and can’t help with that.

    EDIT:
    Empty() removes all the contents. Append() will add the partial inside the div.

    http://api.jquery.com/empty/

    http://api.jquery.com/append/

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

Sidebar

Related Questions

total nubi here and i'm trying to writ an application that trackes how far
Total newbie here, please bear with me. Building a very small personal app that
I'm a total newb to LINQ. Here is the code I have so far:
Ok, this is a total newb question, so please forgive me. What is the
This is probably a total newb question but does anyone know how to make
Total, embarassing noob here, so here goes nothing: if you wanted to create a
total newbie here. i was trying to replace a character in char * but
Total newbie here, so take it as you will... I'm doing a site upgrade
Total newbie here, regarding sqlite, so don't flame too hard :) I have a
total jquery newb here and I'm wondering what the difference in therse two types

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.