Display only the desired parameters

倾然丶 夕夏残阳落幕 提交于 2019-12-02 09:11:49

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

<div class="hero-unit">
  <%- linkTo('Edit this todo', editTodoPath(params.id), {class: 'btn pull-right'}); %>
  <h3>Params</h3>
  <ul>
    <li>todo.title</li>
    <li>todo.property1</li>
    <li>todo.property2</li>
  </ul>
</div>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!