Rails 4 partial with form not rendering -


i have partial file _form.erb.html:

<p>name: </p><%= f.text_field :name %> <p>description: </p><%= f.text_field :description %> <p>price: </p><%= f.text_field :price %> <p>weight: </p><%= f.text_field :weight %> 

and view file items/new.html.erb:

<h1>new item</h1> <%= form_for @item |f| %>     <% render partial: 'form', locals: { :f => f} %>     <p><%= f.submit 'create' %></p> <% end %> 

but, when go 0.0.0.0:3000/items/new see page without form , no errors displayed. i'm doing wrong?

you missing =. should <%= render partial: 'form', locals: { :f => f} %>


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -