Seems the only issues I ever have with Rails are these bizarre fiddly little things that make no sense. Can''t for the life of me understand why I''m getting undefined method on form_for in a view? And it''s actually part of the acts_as_authenticated plugin that''s doing it. But how can it not know about form_for? -- Posted via http://www.ruby-forum.com/.
On 4/24/06, meltman <petony@gmail.com> wrote:> Seems the only issues I ever have with Rails are these bizarre fiddly > little things that make no sense. > > Can''t for the life of me understand why I''m getting undefined method on > form_for in a view? > > And it''s actually part of the acts_as_authenticated plugin that''s doing > it. But how can it not know about form_for? >Can you send over some code that isn''t working for you?
Wilson Bilkovich wrote:> Can you send over some code that isn''t working for you?Yep, dies on line 1: <% form_for :user, @user do |f| -%> The controller executes only one line: @user = User.new(params[:user]) That''s it. Totally boggled. I should know better perhaps than to work on this sort of thing late in the evening. I''m sure it''s something obvious, but it just makes no sense to me right now. -- Posted via http://www.ruby-forum.com/.
On 4/24/06, meltman <petony@gmail.com> wrote:> Wilson Bilkovich wrote: > > Can you send over some code that isn''t working for you? > > Yep, dies on line 1: > > <% form_for :user, @user do |f| -%> > > The controller executes only one line: > > @user = User.new(params[:user]) > > That''s it. Totally boggled. I should know better perhaps than to work on > this sort of thing late in the evening. I''m sure it''s something obvious, > but it just makes no sense to me right now. >form_for creates a <form> tag, so that needs to be: <%= %>, not <% %>.
Wilson Bilkovich wrote:> form_for creates a <form> tag, so that needs to be: > <%= %>, not <% %>.Actually no it''s not. According to the API docs: "Worth noting is that the form_for tag is called in a ERb evaluation block, not a ERb output block. So that?s <% %>, not <%= %>." And changing it to <%= just yields a pile of syntax errors. The mystery continues. -- Posted via http://www.ruby-forum.com/.
On 4/24/06, meltman <petony@gmail.com> wrote:> Wilson Bilkovich wrote: > > form_for creates a <form> tag, so that needs to be: > > <%= %>, not <% %>. > > Actually no it''s not. According to the API docs: > > "Worth noting is that the form_for tag is called in a ERb evaluation > block, not a ERb output block. So that''s <% %>, not <%= %>." > > And changing it to <%= just yields a pile of syntax errors. > > The mystery continues. > > -- >Sorry; too much/not enough wine. (Depends on perspective.) What happens when you do: <% form_for :user, @user, :url => {:action => ''some_action''} do |f| -%> <% end -%> ?
On Apr 24, 2006, at 8:50 PM, Wilson Bilkovich wrote:> On 4/24/06, meltman <petony@gmail.com> wrote: >> Wilson Bilkovich wrote: >>> form_for creates a <form> tag, so that needs to be: >>> <%= %>, not <% %>. >> >> Actually no it''s not. According to the API docs: >> >> "Worth noting is that the form_for tag is called in a ERb evaluation >> block, not a ERb output block. So that''s <% %>, not <%= %>." >> >> And changing it to <%= just yields a pile of syntax errors. >> >> The mystery continues. >> >> -- >> > > Sorry; too much/not enough wine. (Depends on perspective.) > > What happens when you do: > <% form_for :user, @user, :url => {:action => ''some_action''} do |f| > -%> > <% end -%>form_for require rails 1.1 or better. You can''t run acts_as_auth on 1.0 by default anymore because of form_for. -Ezra
Ezra Zygmuntowicz wrote:> form_for require rails 1.1 or better. You can''t run acts_as_auth on > 1.0 by default anymore because of form_for. > > -EzraThat''d be it. Son of a.....bleep! Thanks. Guess it''s time to upgrade. Wish the API docs specified that, might''ve saved me hours of head banging. -- Posted via http://www.ruby-forum.com/.