# Emailer Behavior and Ajax

**URL:** <https://www.ruby-forum.com/t/emailer-behavior-and-ajax/102137>\
**Category:** Radiant CMS\
**Created:** [August 11, 2006, 12:50pm UTC](https://www.ruby-forum.com/t/emailer-behavior-and-ajax/102137 "2006-08-11T12:50:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [August 11, 2006, 12:50pm UTC](https://www.ruby-forum.com/t/emailer-behavior-and-ajax/102137/1 "2006-08-11T12:50:55Z")

</div>

For a variety of reasons, I have to build my website so that all the  
internal links are Ajax requests; that is, the site only has one page  
and the various sections are just updating the main div. This actually  
works just great with radiant (using prototype and event-selectors to  
grab the links) and was much easier than I expected.

The problem comes when I try to use an email form with the Mailer  
Behavior. While the behaviour works when the page is called with a  
normal HTTP request, it gives me a nil.object error with an Ajax  
request. I think the behavior is trying to get the URl and failing, but  
beyond that I am not sure. Using the \<r:url /\> results in no errors, so  
I am not really what is going on.

I realize I am probably bending radiant into something it was not meant  
to be, but up until this, it was going really well. I have a few  
emergency plans, but ideally I would like to get the mailer working…

One other question, any ideas on how to make the links degrade  
gracefully. Right now, if there is not javascript, it just shows the  
Ajax response which is less than ideal.

Any help appreciated.
