<% form_for(@post) do |f| %> does not work!

Hi all

I just stumbled over the examples in

that tells me I could just use

<% form_for(@post) do |f| %>

which should expand to

<% form_for :post, @post, :url => post_path(@post), :html => { :method
=> :put, :class => “edit_post”, :id => “edit_post_45” } do |f| %>

However, this gives me just an error:

`@#Post:0x3309258’ is not allowed as an instance variable name

What’s going on here?!

Thanks for help,
Josh

On 17 Dec 2007, at 01:42, Joshua M. wrote:

which should expand to

<% form_for :post, @post, :url => post_path(@post), :html => { :method
=> :put, :class => “edit_post”, :id => “edit_post_45” } do |f| %>

However, this gives me just an error:

`@#Post:0x3309258’ is not allowed as an instance variable name

Are you using rails 2.0.1 or 1.2.x ? The docs for 1.2.x make no
mention of this usage.

Fred

<% form_for :post, @post

delete :post,

That error is a Rails 1.2.x error. If you had upgraded it probably
didn’t upgrade well. Also, make sure your environments.rb says it’s
2.0.x

On Dec 17, 2007 9:42 AM, Joshua M.
[email protected] wrote:

`@#Post:0x3309258’ is not allowed as an instance variable name

What’s going on here?!

Thanks for help,
Josh


Ramon T.

Thanks :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs