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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:51:00+00:00 2026-06-05T18:51:00+00:00

heres what I’m currently using: Rails -v 3.2.3 I’m trying to make a path

  • 0

heres what I’m currently using:
Rails -v 3.2.3

I’m trying to make a path in routes.rb that will route to a method in my links_controller.rb.

routes.rb

match 'modify_points' => 'links#modify_points', :as => :modify_points

links_controller.rb method

def modify_points
  @link = Link.find(params[:id])
  @link.update_attribute :points, @link.points + params[:by].to_i if params[:by] =~ /[+|-]?1/
  render_text @link.points
end

here is how i am calling the method in my view:

<%= link_to('UP', modify_points_path(link, :by => 1), :remote => true) %>

however when i click on this UP link…. nothing happens. what should happen is link.points should increase by 1, however when i check in the console, my points are still at zero. am i creating the routes correctly?

  • 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-05T18:51:02+00:00Added an answer on June 5, 2026 at 6:51 pm

    I have always used something like this:

    match ‘/modify_points’ => ‘link#modify_points’, :as => ‘modify_points’

    Does that generate the route you want? What does rake routes show?

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

Sidebar

Related Questions

Heres a screenshot to make it clear. I'm trying to figure out a robust
Heres what im trying to do Ive got table that holds many different types
Heres a simple question - is there anyway that a non-console (ie a CWinApp)
Heres a simple php script that generates some XML: <?php // create doctype $dom
Heres the markup: <div id='0203' class='threadWrapper'> <div class='littleme'> I am trying to send the
Heres my saga - I'm trying to link http://www.example.com to my shopping cart on
Heres my regex pattern: [A-Z][a-z]?-?([A-Z][a-z]?)? I want this regex to match the following: A
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Heres the overall code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;
Heres the situation. Component B extends component A and overrides the init method to

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.