I'm trying to follow a railcasts tutorial on Sortable Table Columns, and I am getting an error.
SQLite3::SQLException: no such column: name: SELECT "projects".* FROM "projects" ORDER BY name asc
I've followed the instructions in the tutorial, the only thing that has changed is the table size, name and column names.
Here is my search view:
<table class = "pretty">
<tr>
<th><%= sortable "project_name", "Project name" %> </th>
<th><%= sortable "client", "Client" %></th>
<th>Exception pm</th>
<th>Project owner</th>
<th>Tech</th>
<th>Role</th>
<th>Industry</th>
<th>Financials</th>
<th>Business div</th>
<th>Status</th>
<th>Start date</th>
<th>End date</th>
<th>Entry date</th>
<th>Edited date</th>
<th>Summary</th>
<th>Lessons learned</th>
<th>Customer benifits</th>
<th>Keywords</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @projects.each do |t| %>
<tr>
<td><%= t.project_name %></td>
<td><%= t.client %></td>
<td><%= t.exception_pm %></td>
<td><%= t.project_owner %></td>
<td><%= t.tech %></td>
<td><%= t.role %></td>
<td><%= t.industry %></td>
<td><%= t.financials %></td>
<td><%= t.business_div %></td>
<td><%= t.status %></td>
<td><%= t.start_date %></td>
<td><%= t.end_date %></td>
<td><%= t.entry_date %></td>
<td><%= t.edited_date %></td>
<td><%= t.summary %></td>
<td><%= t.lessons_learned %></td>
<td><%= t.customer_benifits %></td>
<td><%= t.keywords %></td>
<td><%= link_to 'Show', project %></td>
<td><%= link_to 'Edit', edit_project_path(project) %></td>
<td><%= link_to 'Destroy', project, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
EDIT:
This is my db schema
ActiveRecord::Schema.define(:version => 20120717141952) do
create_table "projects", :force => true do |t|
t.string "project_name"
t.string "client"
t.string "exception_pm"
t.string "project_owner"
t.string "tech"
t.string "role"
t.string "industry"
t.string "financials"
t.string "business_div"
t.string "status"
t.date "start_date"
t.date "end_date"
t.datetime "entry_date"
t.datetime "edited_date"
t.text "summary"
t.text "lessons_learned"
t.text "customer_benifits"
t.text "keywords"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
end
Any ideas? Any help at all will be appreciated. I am new to ruby on rails, so go easy :)