rails.nerd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Feb-16 05:48 UTC
working with Blocks
hey I am able to do: block_func(x, y) do .... end But if I try to do this: form.block_func(x, y) do .... end I get an error like this: syntax error, unexpected '')'' @output_buffer.concat " "; @output_buffer.concat (( form.block_func(x, y) do ).to_s); @output_buffer.concat "\n" Any ideas? thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
rails.nerd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Feb-16 08:09 UTC
Re: working with Blocks
I should mention that I am making these functions myself... to use in a view Is there something I need to do to get the function working as a model method in a "do" block? On Feb 16, 4:48 pm, "rails.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <rails.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hey > > I am able to do: > > block_func(x, y) do > .... > end > > But if I try to do this: > > form.block_func(x, y) do > .... > end > > I get an error like this: > > syntax error, unexpected '')'' > @output_buffer.concat " "; @output_buffer.concat > (( form.block_func(x, y) do ).to_s); > @output_buffer.concat "\n" > > Any ideas? > > thanks--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 16 Feb 2009, at 08:09, rails.nerd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > I should mention that I am making these functions myself... to use in > a view > > Is there something I need to do to get the function working as a model > method in a "do" block?some more context would be useful - at a basic level you don''t need to anything in particular to do this (eg when you''re calling fields_for on a form builder). You might have used <%= when you should have used <% Fred> > > > > On Feb 16, 4:48 pm, "rails.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <rails.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> hey >> >> I am able to do: >> >> block_func(x, y) do >> .... >> end >> >> But if I try to do this: >> >> form.block_func(x, y) do >> .... >> end >> >> I get an error like this: >> >> syntax error, unexpected '')'' >> @output_buffer.concat " "; @output_buffer.concat >> (( form.block_func(x, y) do ).to_s); >> @output_buffer.concat "\n" >> >> Any ideas? >> >> thanks > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---