Display only the desired parameters

后端 未结 1 1105
陌清茗
陌清茗 2021-01-28 12:11

I created an app following this tutorial (without scaffolding).

After I create an item I can click on it and it shows me a big list of parameters. Like here: http://s15

1条回答
  •  情深已故
    2021-01-28 13:13

    You need to add view files for todo resource. If you're scaffolding, then geddy creates them by default. But otherwise, you have to add view files for todo in app/views/todos.

    View files

    • _form.html.ejs
      • edit/new form
    • add.html.ejs
      • new resource view
      • /todos/add
    • edit.html.ejs
      • edit view
      • /todos/:id/edit
    • index.html.ejs
      • index view
      • /todos
    • show.html.ejs
      • show individual resource
      • /todos/:id

    You can edit them manually. For changing how a individual todo item should appear on /todos/:id route, edit show.html.ejs

    <%- linkTo('Edit this todo', editTodoPath(params.id), {class: 'btn pull-right'}); %>

    Params

    • todo.title
    • todo.property1
    • todo.property2

    0 讨论(0)
提交回复
热议问题