Skip to content

Instantly share code, notes, and snippets.

@hannesfostie
Created August 1, 2012 09:37
Show Gist options
  • Save hannesfostie/3225469 to your computer and use it in GitHub Desktop.
Save hannesfostie/3225469 to your computer and use it in GitHub Desktop.
def operations_for_company
@operations = []
offers.each do |offer|
@operations << offer.operations
end
@operations
end
NoMethodError in Companies#show
Showing /Users/hannes/dev/offers/app/views/operations/_operation_index_table.html.erb where line #1 raised:
undefined method `id' for #<ActiveRecord::Relation:0x007fde5ee11b00>
Extracted source (around line #1):
1: <tr id="operation_<%= operation.id %>">
2: <td>
3: <% case operation.operationtype(:name) %>
4: <% when 'Meeting' %>
<table class="table table-striped" id='operations_for_company_<%= @company.id %>'>
<%= render :partial => 'operations/operation_index_table_headers' %>
<%= render :partial => 'operations/operation_index_table', :collection => @company.operations_for_company, :as => :operation %>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment