Skip to content

Commit

Permalink
take into account relative root path when generating captcha url
Browse files Browse the repository at this point in the history
  • Loading branch information
soylent committed Jan 25, 2013
1 parent f1ac199 commit 773199b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/simple_captcha/view.rb
Expand Up @@ -62,7 +62,7 @@ def simple_captcha_image(simple_captcha_key, options = {})
defaults[:time] = options[:time] || Time.now.to_i

query = defaults.collect{ |key, value| "#{key}=#{value}" }.join('&')
url = "/simple_captcha?code=#{simple_captcha_key}&#{query}"
url = "#{ENV['RAILS_RELATIVE_URL_ROOT']}/simple_captcha?code=#{simple_captcha_key}&#{query}"

tag('img', :src => url, :alt => 'captcha')
end
Expand Down

0 comments on commit 773199b

Please sign in to comment.