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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:26:48+00:00 2026-05-17T06:26:48+00:00

(Sorry for long post) Ok guys, so I’m having some issues with something I’m

  • 0

(Sorry for long post) Ok guys, so I’m having some issues with something I’m trying, I’ve been trying to fix it for a long time now, and It’s now time to ask for help.

Ok, so I have these “grinders”, and I want a user to vote for each one,

I did two scaffolds:

grinder grinder:string posted_timestamp:datetime poster_ip:string votes_up:integer votes_down:integer

vote grinder_id:integer choice:string voter_ip:string

So I created this as the
grinders index

<% @grinders.each do |grinder| %>
<div id="main">
<div style="float:left; height:80px; width:50px">
    <div class='up'>
        <% form_for(@vote) do |u| %>
            <%= u.hidden_field :grinder_id, :value => grinder.id %>
            <%= u.hidden_field :choice, :value => "down" %>
            <%= u.submit 'Create' %>
        <% end %>  
    </div>
    <center><%=h grinder.votes_up - grinder.votes_down %></center>
    <div class='down'>
        <% form_for(@vote) do |d| %>
            <%= d.hidden_field :grinder_id, :value => grinder.id %>
            <%= d.hidden_field :choice, :value => "down" %>
            <%= d.submit 'Create' %>
        <% end %>  
    </div>

</div>


<div class='box' >"<strong>It grinds our gears </strong><%=h grinder.grinder %>"</div>




</div>
</div>

<% end %>

The Grinders index page looks like this, http://grab.by/6Eik

I also added @vote = Vote.new to the index method of the grinders controller..

And in the votes controller I modified the create method a bit.

  def create
@vote = Vote.new(params[:vote])
@grinder.voter_ip = request.remote_ip
respond_to do |format|
  if @vote.save
    format.html { redirect_to(@vote, :notice => 'Vote was successfully created.') }
    format.xml  { render :xml => @vote, :status => :created, :location => @vote }
  else
    format.html { render :action => "new" }
    format.xml  { render :xml => @vote.errors, :status => :unprocessable_entity }
  end
end
end

but anytime I try to vote, I get the following error. http://grab.by/6EiQ

  • 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-17T06:26:49+00:00Added an answer on May 17, 2026 at 6:26 am

    Fixed it guys, turns out that last migration I did didn’t work… So I had to fix it, and do the migration.

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

Sidebar

Related Questions

Sorry for long winded post. I am trying to understand UIScrollView and running into
Long post.. sorry I've been reading up on this and tried back and forth
Sorry for the long post that follows. I know that it is not a
Sorry for this long post. The question is however small but requires full detail.
Sorry for the long post, but most of it is code spelling out my
Hello (this is a long post sorry), I am writing a application in ASP.NET
this post is a long one sorry for that but the problem is complex
Sorry for the long post, but this forum always asks for use cases :-).
Long post - sorry.... I'm doing input validation for a WCF service and using
Sorry for the long question title. I guess I'm on to a loser on

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.