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 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

Long post.. sorry I've been reading up on this and tried back and forth
this post is a long one sorry for that but the problem is complex
Sorry, I know that this topic has been covered a bit. I've read the
Sorry about this long block of code, but I think it makes sense to
I am using jquery to post vars to a php script. Is it possible
Note: I ended up answering my own question shortly after posting this. Thanks and
I have a form which uploads multiple file fields into a db using codeigniter.
I want to allow user to drag and drop UI elements. I've 'container' and
Just getting started on iPhone dev today and have run through Apple's HelloWorld tutorial:

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.