does anyone know why;
= render_partial ''comments/form'', :object => comment %>
works and
= link_to_function ''Edit'', nil, :id =>
"edit_comment_#{comment.id}_link" do |page|
   - page.replace_html "comment_#{comment.id}", :partial =>
''comments/
form'', :object => comment
blows up basically because the object is not being fed correctly to
the partial, so i get a undefined method ticket for nil.
ps: its done in a loop (I.e: i create a link to edit one comment out
of many) therefore  i cant say comment = @comment and let the partial
sort it.
here is the partial
=== #comments/form
- form_for [form[:object].ticket, form[:object]] do |f|
  = error_messages_for :comment
   = f.text_area :body, :cols => 52, :rows => 10
   = f.submit
thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
"Wolas!" wrote:> = render_partial ''comments/form'', :object => comment %>Use render :partial => ''comments/form'', :locals => { :object => comment } And :locals => is the answer to your other question too. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
genious. thx Another question: Can i put a link_to_function inside a partial that is rendered by a link_to_function? (basically an undo link) On Aug 29, 5:28 pm, Phlip <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> "Wolas!" wrote: > > = render_partial ''comments/form'', :object => comment %> > > Use render :partial => ''comments/form'', > :locals => { :object => comment } > > And :locals => is the answer to your other question too.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---