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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:02:41+00:00 2026-05-31T07:02:41+00:00

I am trying to use the vote_fu gem and I encounter a problem that

  • 0

I am trying to use the vote_fu gem and I encounter a problem that other have as well, but I can’t solve this with others’ solutions..

I don’t think the problem is related directly to the gem.. but rather to some wrong route or a missing parameter..

I have a Msg model which I included the act_as_voteable.
For the User Model I added act_as_voter

In the Msg controller I added

def votefor
    @msg= Msg.find(params[:id])
    current_user.vote_for(@msg)
    redirect_to :back
end

In routes:

 resources :msgs do
        member do
            post :votefor
        end
    end

And to the show of Msg I added

<%= link_to "Vote Up", votefor_msg_path(@msg), :method => :post %>

But when I click on the link created I get

Routing Error

No route matches [GET] "/msgs/1/votefor"

Why does it ‘GET’ instead of ‘POST’? What am I missing?

  • 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-31T07:02:42+00:00Added an answer on May 31, 2026 at 7:02 am

    I think its very late to answer this question & I mostly think you must have figured it out… I ran into the same issue & I understood the reason why..

    This is a sample comment from routes.rb

      # Sample resource route with options:
      #   resources :products do
      #     member do
      #       get 'short'
      #       post 'toggle'
      #     end
    

    the post 'toggle' here is not the post-controller but :method => 'post'

    link_to default uses :method => 'get' but you can override it using :method => 'post'

    if u use link_to .. in the example without :method => 'post'

    your routing should be

    resources :msgs do
       member do
       get :votefor
       end
    end
    

    Hope this helps!

    Update:

    For the doubt you have:

    link_to with a :method => :post

    use this

    <%= link_to "Vote Up", votefor_msg_path(@msg), :method => :post %>
    

    and in the routes it should be

    resources :msgs do
           member do
           post :votefor
           end
    end
    

    the post :votefor .. is :method => :post not the posts controller.

    Do check for brady8’s answer

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

Sidebar

Related Questions

This is similar to a few other threads i have found, but I haven't
Im trying use a Java annotation in a Groovy class but have trouble to
Hi I'm trying use a datepicker on a field I have. I'm trying to
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
trying to use this route: from(activemq:profiles).aggregate(header(cheese)).batchSize(30).bean(ProfilesQueueService, saveContacts) Fails with: No signature of method: org.apache.camel.model.RouteType.aggregate()
I've been trying to solve this out for about 4 hours (searching on google
I'm trying to use the django-voting tutorial from this blog: http://new.justinlilly.com/blog/2008/nov/04/django-voting-a-brief-tutorial/ to get a
i am trying to parse this xml file into an object to use the
I'm trying to use scalaz validation in our project and have ran into a

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.