John et al,

Thanks to everybody for the ideas and pointers. since I found a way to do a simple registration form I thought I should report on my findings. I have attached the behavior just in case it can help anybody out there. It is heavily modeled after (read ripped from) the Mailer behavior. BTW, the Mailer ehavior has some nice general form creation tags although I wonder if/how to use the builtin Rails helpers for that. Anyway, here's how I use it:

Register Page
==========================
body
--------------------------
<p>Register with us</p>
<br />
<r:registration:form name="register">
  <r:errors />
  <r:success />
  <label>First Name:<br/><r:text name="first_name" /></label><br/>
  <label>Last Name:<br/><r:text name="last_name" /></label><br/>
  <label>Phone:<br/><r:text name="phone" /></label><br/>
  <label>Email:<br/><r:text name="email" /></label><br/>
  <label>Subscribe:<br/><r:checkbox name="subscribed" value="1" /></label><br/>
  <label>Comments:<br/><r:textarea name="comments" /></label><br/>
  <br /><r:submit value="Register" /><br />
  <br /><r:debug /><br />
</r:registration:form>
<br />
<br />
--------------------------
config
--------------------------
registrations:
  register:
    redirect_to: /register/thank-you

The only real problem I faced was that I could not get the behavior to respect process() (it would not run by any means). So I moved to using a before filter to process the POST but I still cannot redirect after processing. I'm sure I am missing something but the original Mailer bahavior would not send emails either or bark about it. BTW, I'm running this on 0.5.2 unpacked. For me redirecting sometimes is a requirement so if anybody has any ideas on why it is not working please let me know.



On 8/10/06, John W. Long <[EMAIL PROTECTED]> wrote:
Adrian Madrid wrote:
> Is that how you would do it? Or do I need another pure Rails site
> (forms.domain.com) to process dynamic data?

One way to do this is to use a behavior. Matt McCray has created a
Mailer behavior which might do what you want:

   http://mattmccray.com/svn/rails/plugins/radiant_mailer_behavior/

If this proves difficult the forms.domain.com approach might work well
for you.

--
John Long
http://wiseheartdesign.com
_______________________________________________
Radiant mailing list
[email protected]
http://lists.radiantcms.org/mailman/listinfo/radiant



--
Adrian Esteban Madrid

Attachment: registration_behavior.rb
Description: Binary data

_______________________________________________
Radiant mailing list
[email protected]
http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to