A question about rails view code


#1

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.label :HostName %>
<%= f.text_field :HostName %>

...

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

thanks.


#2

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