Posting a form to a secure target?


#1

All,

If I want my form action to be a secure target, what is the best way to
go about doing that?

I’m trying to do:

<%= start_form_tag( { :protocol => ‘https://’, :host => request.host +
‘:3001’, :action => ‘login’ } ) %>

in my view, but this doesn’t seem to generate a URL with https:// and my
SSL host in it.

What am I missing?

Wes


#2

Wes G. wrote:

All,

If I want my form action to be a secure target, what is the best way to
go about doing that?

I’m trying to do:

<%= start_form_tag( { :protocol => ‘https://’, :host => request.host +
‘:3001’, :action => ‘login’ } ) %>

in my view, but this doesn’t seem to generate a URL with https:// and my
SSL host in it.

What am I missing?

Wes

OK, my start_form_tag specification doesn’t work because the url_for in
ActionView::Helpers::UrlHelper forces the “only_path” option to url_for
in ActionController::Base to be true, which means that the protocol and
host will be ignored.

Can someone explain to me why UrlHelper.url_for is coded this way?

Thanks,
Wes