# Need help with rjs for captcha? simple for you not for me!

**URL:** <https://www.ruby-forum.com/t/need-help-with-rjs-for-captcha-simple-for-you-not-for-me/89840>\
**Category:** Rails\
**Created:** [March 23, 2007, 3:14am UTC](https://www.ruby-forum.com/t/need-help-with-rjs-for-captcha-simple-for-you-not-for-me/89840 "2007-03-23T03:14:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [March 23, 2007, 3:14am UTC](https://www.ruby-forum.com/t/need-help-with-rjs-for-captcha-simple-for-you-not-for-me/89840/1 "2007-03-23T03:14:24Z")

</div>

is this correct? my page after the action calls…shows html in my  
browser…

details/detail\_view.rhtml

 \<%= error\_messages\_for 'post' %\>

\<%= form\_remote\_tag :url =\> { :action =\> ‘checkcaptcha’ }, :html =\> {  
:id =\> ‘post\_form’ } %\>  
\<%= show\_simple\_captcha(:image\_style =\> ‘simply\_blue’,  
:label =\> ‘To view contact information, type the content and submit’)  
%\>  
\<%= hidden\_field ‘content’, ‘recid’, :value =\> @viewObj.id %\>  
\<%= submit\_tag “Submit”%\>  
\<%= end\_form\_tag %\>

controller  
if simple\_captcha\_valid?  
…stuff  
end

render “details/checkcaptcha”, :layout =\> “layouts/article”

details/checkcaptcha.rjs  
logger.debug “success here!”  
page.visual\_effect :fade, ‘post\_form’, :duration =\> 0.5  
page.hide ‘captcha\_error’  
page.replace\_html ‘captcha\_error’, ‘Post Created’  
page.visual\_effect :appear, ‘captcha\_error’, :duration =\> 0.5  
page.form.reset ‘post\_form’

…

i think my problem may have something to do with the location of my  
files? i think my rails app expects my .rjs and details page to be both  
in the controller folder. but i currently have my details rhtml in a  
details folder outside the controller view folder. is this bad?

thanks for any help!

---

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [March 23, 2007, 4:17am UTC](https://www.ruby-forum.com/t/need-help-with-rjs-for-captcha-simple-for-you-not-for-me/89840/2 "2007-03-23T04:17:19Z")

</div>

nevermind, found the problemo! since i was using a different layout to  
render…i forgot to add the javascript in the new layout!..
