Okay, I am attempting to perform the following which I know how to do so in PHP but not in Ruby on Rails:
SELECT * FROM calls WHERE (status = 'open') OR (status = 'pending')
Simply look in the database in the calls table for open or pending status.
I'd like to do this in Rails. Currently I've got this in my controller:
class CallsController < ApplicationController
def index
@calls = Call.all
end
end
And this is my view:
<table>
<% @cals.each do |call| %>
<tr>
<th><%= link_to call.id, call_path(call) %></th>
<th><%= call.cname %></th>
<th><%= call.cbn %></th>
<th><%= call.email %></th>
<th><%= call.operator %></th>
<th><%= call.reason %></th>
<th><%= call.ticket %></th>
<th><%= call.created_at %></th>
<th><%= call.tier %></th>
<th><%= call.status %></th>
<th><%= link_to 'Edit', edit_call_path(call) %></th>
<th><%= link_to 'Remove', call_path(call), method: :delete, data: { confirm: 'Are you sure?' } %></th>
</tr>
<% end %>
</table>
@calsinstance variable there, but in your controller it's assigned as@calls.