Hi all I just stumbled over the examples in http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 17 Dec 2007, at 01:42, Joshua Muheim wrote:> > Hi all > > I just stumbled over the examples in > > http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html > > 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 >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, -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ramon Miguel M. Tayag
2007-Dec-17 03:37 UTC
Re: <% form_for(@post) do |f| %> does not work!
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 Muheim <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> `@#<Post:0x3309258>'' is not allowed as an instance variable name > > What''s going on here?! > > Thanks for help, > Josh-- Ramon Tayag --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks :-) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---