-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I found that if you create a new app with the steps below and then go to the index page, it works as long as you are using rails 4.1.0.beta2 and below but if you use rails 4.1.0.rc1, and navigate to the index page, you will get ActionView::Template::Error (undefined method `to_sym' for nil:NilClass):. I am on *ruby 2.1.0p0 *.
How to reproduce the bug:
a. create a new rails app with rails 4.1.0.rc1
b. Point gemfile to master
gem 'mongoid', github: "mongoid/mongoid"
c. rails g mongoid:config
d. Scaffold a resource
rails g scaffold post body:string
e. Don't create any record, just start your server and navigate to localhost:3000/posts
This will throw the error;
ActionView::Template::Error (undefined method `to_sym' for nil:NilClass):
9: </thead>
11: <tbody>
12: <% @messages.each do |message| %>
13: <tr>
14: <td><%= message.body %></td>
15: <td><%= link_to 'Show', message %></td>
app/views/messages/index.html.erb:12:in `_app_views_messages_index_html_erb*250078575*604951838'
Also I discovered that even when using rails 4.1.0.beta2 and earlier versions, it only works when I use the scaffold generator. If I use rails g resource and manually create each controller action and their corresponding view files, it begins to throw the old error I pasted earlier.