Forum: Ruby on Rails Posting a form to a secure target?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-05-30 20:38
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
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-05-30 20:53
Wes Gamble 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
This topic is locked and can not be replied to.