Displaying 3 results from an estimated 3 matches for "valid_with_captcha".
2011 Sep 09
9
Captcha conception
Hi guys, the next problem:
I create a controller, (/controllers/rmagick_controller.rb), which have
aim to test an captcha
Actions:
def download # creates an captcha image
def show # show the page where image took place
def check # must check right captcha or wrong
views/rmagick/show.html.erb:
> <div id="captcha">
> <p><%= image_tag download_rmagick_path
2007 Oct 24
1
simple_captcha + model
Hi Experts,
l have model called User
class User < ActiveRecord::Base
apply_simple_captcha
end
in view
<%= show_simple_captcha(:object=>"user") %>
in controller
@user = User.fiind(params[:id])
if @user.valid_with_captcha?
if @user.update_attributes(params[:use])
--------
else
---------
end
else
--------------------
end
as per this code is working fine, but all the text which i''ve entered
in textfields are cleared, and shows error appropriate error like
first_name an...
2010 Apr 06
1
captcha in a belongs_to
...m'' %>
</p>
<%end %>
And in staff.rb
apply_simple_captcha :message => "Verification code does not match with
image."
And in update action of of staff controller
def update
@staff = Staff.find(params[:id])
@user = @staff.user
if @staff.valid_with_captcha? and
@user.update_attributes(params[:user])
flash[:notice] = "check your mail "
redirect_to login_url
else
flash.now[:error] = @staff.errors.full_messages.join("<br />")
#This I wrote deliberately
render :action => :edit
end...