rails:251
From: take_tk <ggb03124@n...>
Date: Tue, 12 Jul 2005 15:16:19 +0900
Subject: [rails:251] start_form_tag でコントローラを指定する方法
たけ(tk)です
----
[Rails] Any way to specify different controller in start_form_tag?
I'm trying to place a login form as a part of my layout that will appear at
the top right corner of the screen if the user is not logged in. This form
needs to specify a controller, since it could be called from a number of
different controllers. Is there any easy way to do this? start_form_tag does
not seem to accept a :controller setting.
Thanks,
Carl
----
ログインフォームを作っているのですが、このフォームではコントローラを特定
する必要があります。というのは、いろいろなコントローラからこのフォームが
呼ばれるからです。
コントローラを指定する簡単に行う方法はありますか? start_form_tag で
:controller をセットしてみましたがうまくいきませんでした。
----
Yes it does. Check out the ref for start_form_tag/form_tag. Takes
the same options as url_for. I would guess that you're just not
specifying them correctly.
start_form_tag({ :action => "action", :controller => "controller"}, {
options... })
You've probably just got start_form_tag(:controller => "controller"),
which won't work. Have to throw it in {}
Pat
----
出来ますよ。start_form_tag/form_tag のリファレンスを調べてみて下さい。
url_for のオプションと同じモノが使えます。こんな感じになるでしょう。
start_form_tag(
{ :action => "action", :controller => "controller"},
{ options... })
おそらく、あなたは
start_form_tag(:controller => "controller")
というように書いたんじゃないでしょうか? これだと、うまくいきません。
{} で囲む必要があります。
Take_tk = KUMAGAI Hidetake
たけ(tk)=熊谷秀武
--
ML: rails@r...
使い方: http://QuickML.com/
-> 251 2005-07-12 08:16 [ggb03124@n... ] start_form_tag でコントローラを指定する方法 252 2005-07-12 08:54 ┗[crouton@e... ] 254 2005-07-12 09:34 ┗[ggb03124@n... ] Railsの本家のMLです。 255 2005-07-12 09:41 ┣[crouton@e... ] 256 2005-07-12 09:45 ┃┗[abe@c... ] 268 2005-07-12 16:15 ┗[babie7a0@y... ] 269 2005-07-12 16:56 ┗[inoue@f... ]