On Tue, Dec 2, 2008 at 4:17 PM, Leximo <[EMAIL PROTECTED]> wrote:
>
> I have an app that allows users to submit words. In development, users
> can submit words, which are then voted on. Each user can only vote
> once. This works fine in development.
>
> However, when I deploy to my production server, users cannot seem to
> vote. They click vote, and nothing happens.
>
> This is killing and I don't know what could be the problem. My code
> for voting is below:
>
> # Voting Model
>
> class Vote < ActiveRecord::Base
> belongs_to :word, :counter_cache => true
> belongs_to :user
> validates_uniqueness_of :user_id, :scope => :word_id
> end
>
> # Voting Controller
>
> class VotesController < ApplicationController
> before_filter :login_required
>
> def create
> @word = Word.find(params[:word_id])
> @word.votes.create(:user => @current_user)
>
> respond_to do |format|
> format.html { redirect_to @word }
> format.js
> end
>
> end
>
> end
>
> #Voting view (create)
>
> page.replace_html 'vote_score', "Score: [EMAIL PROTECTED]"
> page[:vote_score].visual_effect :highlight, :duration => 2.0
> page[:vote_score].visual_effect :pulsate, :duration =>
> 1.5, :collection => @word.votes.latest
>
> #voting view (edit)
>
> page.replace_html 'vote_score', "Score: [EMAIL PROTECTED]"
>
> page[:vote_score].visual_effect :highlight, :duration => 2.0
>
> page[:vote_score].visual_effect :pulsate, :duration => 1.5
>
> I could really use some help. Thanks in advance.
>
>
Have you checked your production logs?
Robby
--
Robby Russell
Chief Evangelist, Partner
PLANET ARGON, LLC
design // development // hosting
http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---