I'm building a very simple rails app without resource routing.
I haven't called trans_application_path
but view returned an error undefined method `trans_application_path' for ...
here's my code. any ideas?
Controller
# GET /trans/drafts
def drafts_index
@trans_drafts = TransApplication.where(applied: false)
end
# GET /trans/apps
def apps_index
@trans_apps = TransApplication.where(applied: true)
end
View
<p id="notice"><%= notice %></p>
<h1>drafts_index</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Department</th>
<th>Month</th>
<th>Applied</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @trans_drafts.each do |trans_draft| %>
<tr>
<td><%= trans_draft.name %></td>
<td><%= trans_draft.department %></td>
<td><%= trans_draft.month %></td>
<td><%= trans_draft.applied %></td>
<td><%= link_to 'Show', trans_draft %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
What I've done
- generated Scaffold
- stop using resource routing and modified the controller.