I'm trying to use this (http://ambethia.com/recaptcha/) reCAPTCHA
plugin and have almost got it working. Help me get the last part? I
can't seem to find anything in the logs that indicate an error.

Here is my code. Everything is working good except that part where the
code that's typed is actually validated. Instead, it keeps kicking
back an error. Everything appears to be installed correctly, since the
reCAPTCHA box is showing up; it's just not letting my form save even
though the words are typed correctly.

new.html.erb:
...
<%= recaptcha_tags %>
  <br />
  <%= f.submit 'Submit Your Job' %>
<% end %>

jobs_controller.rb:
def create
    @job = Job.new(params[:job])

    respond_to do |format|
        if verify_recaptcha
      @job.save
        flash[:notice] = 'You job listing was successfully created.'
        format.html { redirect_to(@job) }
        format.xml  { render :xml => @job, :status
=> :created, :location => @job }
      else
        flash[:notice] = 'There was an error with the reCAPTCHA,
please
try again.'
        format.html { render :action => "new" }
        format.xml  { render :xml => @job.errors, :status
=> :unprocessable_entity }
      end
    end
  end

Thanx in advance,

Eric

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

Reply via email to