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.
(Guest)
on 2009-02-16 09: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
(Guest)
on 2009-02-16 10: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, "removed_email_address@domain.invalid" 
<removed_email_address@domain.invalid>
Frederick C. (Guest)
on 2009-02-16 13:15
(Received via mailing list)
On 16 Feb 2009, at 08:09, removed_email_address@domain.invalid 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.