Forum: Ruby on Rails form_tag with protocol => 'https' help

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.
Curtis Spencer (Guest)
on 2006-02-17 09:34
(Received via mailing list)
Hi,

I am not having much luck using the form_tag with a protocol.   I try
the following in my view: index.rhtml

 <%= form_tag({:controller => 'home',:action => 'login',:protocol =>
'https'},{:method => 'post'}) %>

hoping it would generate

<form action='https://myhost.com/home/login' method='post'>

but I got the following

<form action='/home/login' method='post'>

I also tried to sanity check by just doing

<%= url_for :controller => 'home',:action => 'login',:protocol =>
'https' %>, and I still just get '/home/login' as the resulting string.

Anyone see where I am going astray?

Thanks,
Curtis
Kent S. (Guest)
on 2006-02-17 09:40
(Received via mailing list)
Try

<%= form_tag({:controller => 'home',:action => 'login',:protocol =>
'https://', :only_path => false},{:method => 'post'}) %>

Kent
---
http://www.datanoise.com
Curtis Spencer (Guest)
on 2006-02-17 10:28
(Received via mailing list)
Thanks Kent.  That did the trick!

-Curtis
This topic is locked and can not be replied to.