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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:05:19+00:00 2026-06-07T06:05:19+00:00

So I have a page with several messages, each with a link that changes

  • 0

So I have a page with several messages, each with a link that changes (refines) the RATING of that message. When a user clicks on this link, I want an AJAX call that updates the corresponding column value in the database for that message. When this link is clicked, nothing should happen visibly. There should be no page refresh or reload.

I’ve been trying to do this using link_to remote: true, but I can’t seem to get it to work. Documentation online is fairly unclear on this question and with the changes between Rails 2 and 3, some things like :with are no longer supported.

I’ve copied what I have so far, but I know its far from even coming close to a solution.
In terms of parameters I need passed into the database, I need the profile_id, the message_id and the new_rating.

Thanks in advance!

show.html.haml

.status-bar
  = link_to "", { action: :refine_result }, remote: true

profile_controller.rb

...

def refine_result
  @refinement = ResultRefinement.new
  @refinement.profile_id = params[:profile_id]
  @refinement.message_id = params[:message_id]

  @refinement.save

  respond_to do |format|
    format.html { render nothing: true }
    format.js { render nothing: true }
  end
end

result_refinement.rb

class ResultRefinement < ActiveRecord::Base
  attr_accessible :profile_id, :message_id, :new_rating, :deleted

  belongs_to :profile
end
  • 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-07T06:05:20+00:00Added an answer on June 7, 2026 at 6:05 am

    You need to set up a route for ProfileController#refine_result first. Something like

    match '/profile/refine_results' => 'profile#refine_results', :as => 'refine_results'
    

    Then you can use

    .status-bar
      = link_to "", refine_results_url(profile_id: 1, message_id: 100, new_rating: "awful"), remote: true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that has several ajax submission forms. Each form has a
I have a page that contains several forms, by submitting each one of them,
i have a page that contains several submit buttons however i only want one
I have a complex page that has several user controls like galleries, maps, ads
I have a page which lists several messages, and each of these messages has
I have a page and in that page i have several user controls, so
I have several ReorderLists on a page. Each list has items added to it
I have a .jsp page that the user loads directly. The request it with
I'm at a standstill with this code. I have one page with several divs,
We have a page of search results which the user can hit in several

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.