Forum: Ruby on Rails working with Blocks

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B2099e6049b78ac28d07e5d8f0a01300?d=identicon&s=25 rails.nerd@gmail.com (Guest)
on 2009-02-16 08:29
(Received via mailing list)
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
B2099e6049b78ac28d07e5d8f0a01300?d=identicon&s=25 rails.nerd@gmail.com (Guest)
on 2009-02-16 09:09
(Received via mailing list)
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...@gmail.com" <rails.n...@gmail.com>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-02-16 12:15
(Received via mailing list)
On 16 Feb 2009, at 08:09, rails.nerd@gmail.com 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
This topic is locked and can not be replied to.