pludoni / simple-captcha

Rails 3+4 support now! Simple Captcha is the simplest and a robust captcha plugin. Its implementation requires adding up a single line in views and in controllers/models.
MIT License
106 stars 73 forks source link

404 when image URL is not loaded from rails page #24

Closed lionello closed 10 years ago

lionello commented 10 years ago

I'm trying to integrate simple-captcha into a non-rails page, but even though I can get the captcha through a call to my rails API, the generated img "src" always assumes it will be used by the same rails app.

I need a way to force the generated img "src" to use the absolute URL.

This code in view.rb needs to change:

        url = "#{ENV['RAILS_RELATIVE_URL_ROOT']}/simple_captcha?code=#{simple_captcha_key}&#{query}"

Also, that line is duplicated in that file and could be refactored.

lionello commented 10 years ago

https://github.com/pludoni/simple-captcha/pull/25

lionello commented 10 years ago

PR #26

lionello commented 10 years ago

Merged