Forum: Ruby on Rails A question about rails view code

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.
Zhao Y. (Guest)
on 2008-11-23 14:06
I am new to rails. I read some examples and don't understand rails erb
syntax. There is a piece of code I am not familiar:

<% form_for(@bay_info) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :HostName %><br />
    <%= f.text_field :HostName %>
  </p>
...

I wander what f mean. What is its type? How can I find its definition?

thanks.
Frederick C. (Guest)
on 2008-11-23 14:26
(Received via mailing list)
Sent from my iPhone

On 23 Nov 2008, at 12:06, Zhao Yi <removed_email_address@domain.invalid>
wrote:

>
> I am new to rails. I read some examples and don't understand rails erb
> syntax. There is a piece of code I am not familiar:
>
> <% form_for(@bay_info) do |f| %>
>  <%= f.error_messages %>
>
f is a form builder. If my memory is correct the docs for form_for
should have some details.

Fred
This topic is locked and can not be replied to.