[Rails] form action in mail (actionmailer)

frannyzooey at mac.com frannyzooey at mac.com
Wed Mar 2 17:17:11 GMT 2005


Hi everyone. : )

I meet problem when use form tag in actionmailer. (content-type is text/html, surely)
I want to use form action in actionmailer's view (.rhtml) for some reason.


1. I use start_form_tag helper method as normally, but how I can ?

I did <%= start_form_tag :action => "http://myhostname/mycontroller/myaction" %> or

<%= start_form_tag :action => "myaction", :action_prefix => "http://myhostname/mycontroller" %>

but met same errors

    /gems/actionpack-1.3.1/lib/action_view/helpers/url_helper.rb:11:in `send'
    /gems/actionpack-1.3.1/lib/action_view/helpers/url_helper.rb:11:in `url_for'
    /gems/actionpack-1.3.1/lib/action_view/helpers/tag_helper.rb:35:in `start_form_tag'
    (erb):5:in `render_template'


2. so I changed my appoach to plain html likes 

<form action="http://myhostname/mycontroller/myaction" method="post">
blah blah, most hidden type
<input type="submit">
</form>

then, when I click submit from mail client,  Rails identify it as "get request" not "post request".

What happend? 


Thanks for any advance : )





More information about the Rails mailing list