> On Dec 13, 2019, at 4:40 AM, fugee ohu <fugee...@gmail.com> wrote:
> 
> In this form created by the scaffold generator all the field names are 
> prepended with the table_name plus underscore What causes this to happen in 
> rails 5.1.7
> 
>   <div class="field">
>     <%= form.label :start_date %>
>     <%= form.datetime_select :start_date, id: :auction_listing_start_date %>
>   </div>
> 

Take a look at the `form_with` method at the top of the form. What is the 
variable declared inside the block at the end of that line? That's what you're 
seeing here, nothing more. The declared variable for the form builder is what 
precedes every form helper method inside the block. In the past, it was 
traditionally `f`. In never versions, they use `form`. It doesn't matter what 
you use, as long as it is consistent throughout the form_with or form_for block.

Walter

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/75E7B1E2-51F5-4839-B4C9-EACCEB5E30D9%40wdstudio.com.

Reply via email to