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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:53:08+00:00 2026-05-29T12:53:08+00:00

I have an otherwise functioning rails project where I’m trying to update some form

  • 0

I have an otherwise functioning rails project where I’m trying to update some form controls to work over AJAX instead of HTML. But my controller continues to handle it as HTML instead of JS and I’m not sure why.

The link I’m trying to make remote in my users/index.html.erb:

<%= link_to 'Disable', disable_user_path(user), :confirm => 'Are you sure?',
:method => :put, :remote => true %>

Rendered as:

<a href="/users/1/disable" data-confirm="Are you sure?" data-method="put"
data-remote="true" rel="nofollow">Disable</a>

My Users Controller:

def disable
  @user = User.find(params[:id])
  if @user.update_attribute(:enabled, false)
    respond_to do |format|
      format.html { redirect_to root_path, :flash => { :success => "Disabled." }}
      format.js {}
    end
  else
    redirect_to root_path, :flash => { :error => @user.errors.full_messages }
  end
end

My includes in application.html.erb:

<%= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", "//ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js", "jquery.rails.js", "application" %>

I think I pulled down the third and fourth files from a standard place, but if those are possibly the culprit I can look inside them or track down more information about them.

When I test it, it doesn’t prompt me with “Are you sure?” and it responds with the redirection and “Disabled” flash message, and the server logs confirm it’s being handled as html.

Started GET “/users/1/disable” for 127.0.0.1 at 2012-02-11 17:17:31
-0200 Processing by UsersController#disable as HTML

  • 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-29T12:53:10+00:00Added an answer on May 29, 2026 at 12:53 pm

    You may still need to include the unobtrusive javascript adapter if you have not done so already.

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

Sidebar

Related Questions

I have been able to copy the raw data from an otherwise inaccessible USB
I have a generic class that should allow any type, primitive or otherwise. The
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have a HTML table where some rows have a button like this: <td
I have an otherwise working iPhone program. A recent change means that it generates
I have created an otherwise empty ASP.NET MVC 3 application with 2 controllers, HomeController
I have readed something about it i wanna to do some implementation using this.
I have got a Listbox and i want to add some Items. There are
i'm trying to have a floated div (call it 'sidebar') display 100% of container
I have group and user where group must have an owner otherwise he couldn't

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.