we use
(1..10).each do |i|
p i
end
so that a value is "yield" to i in a block...
but what about
<% form_for @story do |f| %>
<%= f.text_field :name %>
<% end %>
there is no loop at all... why do we need to make it look like a loop? Can't we do it without making it look like a loop? (write in another way)?
Also, must be use a Story instance here? Can't we just use :story and achieve the same result? The @story instance is just newly created and has no data at all -- does it actually help creating the form? Can't :story suffice already? thanks.
Update:
is the idea similar to: (just pseudo code)
with_model_give_form (@story) do |f|
f.begin_form
f.text_field :name
f.end_form
end
so i think the block method will save the begin_form and end_form because it automatically add the begin and end before and after calling the block. is that the main benefit?