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

  • Home
  • SEARCH
  • 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 8573049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:09:45+00:00 2026-06-11T19:09:45+00:00

i have a problem with ajax request: in my app i am trying to

  • 0

i have a problem with ajax request:

in my app i am trying to configure a simple rank system, and i set it up, but whan i click on rank button – i reload the page and rank is refreshed.

Help my realize that in ajax:

i done that:

in posts/show.html.erb i have that:

    <div id='vote_update'>
      <%= render 'vote/update' %>
    </div>

in vote/_update.html.erb i have :

<% if can? :update, Vote %>
    <%= form_for([@post, @post.vote], remote: true) do |f| %>
...
<%= f.submit "vote" %> 

in vote/update.js.erb i have:

$('#vote_update').html("<%= j render('vote/update') %>");

and in vote_controller.rb i have:

  def update
    post = Post.find(params[:post_id])
    vote = post.vote
...
    respond_to do |format|
        if vote.save
          format.html { 
            redirect_to post_path(post),
            :notice => "You vote counted!"
          }
          format.js
        end
    end
end

if i remove romete: true – everything goes right ( page is reload, i saw (:notice) “You vote counted!” and rating is updated, but if i put remote: true back, i saw nothing ( some mistakes in firebug console ) – but when i reload page – ratign is updated, nd i saw norml result – i think i madesome mistakes in redirecting or i dont know

help please

  • 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-11T19:09:46+00:00Added an answer on June 11, 2026 at 7:09 pm

    your ajax code will come in format.js block. where you can update the html where you are showing the rank.

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

Sidebar

Related Questions

I have a problem with an animation in jQuery using ajax. On the click
I have set up an AJAX contact form on a client's website. The problem
I have a puzzling problem with trying to make an ajax/static state program. What
I have a link in my rails app setup to make an ajax request
I'm trying to make a POST request to my Sinatra app, but I'm having
I have problem firing an ajax request with Primefaces <f:metadata> <f:viewParam name=token value=#{clientBean.token}/> <f:event
i have problem.. for(a=1;a<10;a++){ $(.div).append(<div id=+a+></div>) $.ajax({ url: file.php, data: a=+a, type: POST, async:
i have a little problem with my Ajax calls. Maybe i do not have
I have this problem that my sites uses alot of ajax and when a
I have a problem consistently displaying Facebook Comments on my AJAX driven website. Each

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.