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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:39:37+00:00 2026-05-22T20:39:37+00:00

After some research as to how I should replace Prototype with jQuery I’ve ended

  • 0

After some research as to how I should replace Prototype with jQuery I’ve ended up with this jquery-rails:

gem 'jquery-rails', '>= 1.0.3'
rails g jquery:install
rails s

I’ve included the :defaults files (which jquery-rails should have replacements for) but I’m getting errors when implementing an AJAX login script. Creating sessions and logging the user in goes well, but the code generates errors:

TypeError: Object function Element() {
[native code] } has no method ‘update’
Element.update(“sidebar”, “:partial =>
‘layouts/user'”);

Controller:

sign_in user
  respond_to do |format|
    format.js {
      render :update do |page|
        page.replace_html 'sidebar' , ":partial => 'layouts/user'"
      end 
    }

Form:

<nav id="sidebar">
    <%= form_for :session, :url => sessions_path, :remote => true do |f| %>
      <div>
        <%= f.label :email %><br />
        <%= f.text_field :email, :class => "span-4" %>
      </div>
      <div>
        <%= f.label :password %><br />
        <%= f.password_field :password, :class => "span-4" %>
      </div>
      <div>
        <%= f.submit "Sign in" %>
      </div>
    <% end %>
</nav>

If I’m not mistaken jquery-rails is supposed to be a drop-in replacement for Prototype. So I’m guessing I’m doing something wrong?

Edit:
Added the sidebar nav

  • 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-22T20:39:38+00:00Added an answer on May 22, 2026 at 8:39 pm

    The problem is that page.replace_html is a prototype function. See this question for reference. Unobtrusive Javascript is your best bet.

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

Sidebar

Related Questions

After some find and replace refactoring I ended up with this gem: const class
After doing some research I feel this should work, however it is not saving
[Edited: After cross-testing on a fresh machine and some additional research, this appears to
After some research, it is my understanding that this is not possible. I can
I am currently writing a paper on the Android platform. After some research ,
After doing some research on the subject, I've been experimenting a lot with patterns
After some stupid musings about Klingon languages, that came from this post I began
after some research, we opted for working with Drupal on our next project and
I work on the PCI DSS compliance of my company. After some research, i
After some time I wanted to update my git repo, and then something went

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.