Home > other >  Rails - Where can I edit the views for my form?
Rails - Where can I edit the views for my form?

Time:03-08

I am new to rails and so I have used the rails generate scaffold method and created CRUD functionality for the "barber" model.

I've edited the index.html.erb with bootstrap to my liking with no problem.

This is my new.html.erb file.

<h1>New Barber</h1>


<%= render 'form', barber: @barber %>

<%= link_to 'Back', barbers_path %>

This is how my barber model looks like.

t.string "first_name"
    t.string "last_name"
    t.integer "age"
    t.string "email"

I have this ugly form being displayed in new.html.erb file, for creating a new barber record but I don't know how or where I can modify the view for this form ?

CodePudding user response:

I assume that you used command rails generate scaffold documented here. The answer to your question is listed there as app/views/posts/_form.html.erb. Replace "posts" with "barbers" to find the file you are looking for.

  • Related