Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Simple Ruby on Rails Application Customizing Forms Creating Relationships

NoMethodError in Statuses#index

I am currently getting this error everywhere that full_name is being used and I am not sure what I have done wrong, any help would be appreciated:

Showing C:/Users/John Doherty/Documents/Personal/Other Projects/Ruby Example/Test/Test/app/views/layouts/application.html.erb where line #19 raised:

undefined method `+' for nil:NilClass Extracted source (around line #19): </ul> <ul class="nav pull-right"> <% if user_signed_in? %> <li><%= link_to current_user.full_name, edit_user_registration_path %></li> <li><%= link_to "Log Out", destroy_user_session_path, method: :delete %><li> <% else %> <li><%= link_to "Register", new_user_registration_path %></li>

Rails.root: C:/Users/John Doherty/Documents/Personal/Other Projects/Ruby Example/Test/Test

app/models/user.rb:16:in full_name' app/views/layouts/application.html.erb:19:inapp_views_layouts_application_html_erb__706821060_29678100'

I have just outputted what first and last name actually equal to through a label, which it turns out nothing apparently! So what does this mean now, what have I done wrong? I am using 4.1.1 ruby, maybe it is something to do with the parameters maybe for the statuses_controller.rb?

2 Answers

Hey you will not be able to follow along using version 4.1. Devise is not compatible with rails 4.1. It is possible that devise will release an update to make it compatible with the newer version of rails but until then. I highly recommend uninstalling rails 4.1 and installing rails 3.2 which is what they use on the videos. I had the same issue like you. From what I have read in other forum post they are working on newer videos that show you how to use rails 4. As a matter of fact not to long ago they updated the Ruby on Rails track and you can switch to the newer track however it does not include the project you are working on now.

Right okay thanks very much!

I use Devise with Rails 4.1 and it seems to be working for me :) however the code that they use in the video might not work in Rails 4.1.

Take a look at this post it might help you out with this issue.

https://teamtreehouse.com/forum/got-a-problem-with-devise-attraccessible-and-rails-4

What I'm going to have to do is to downgrade my version. However I emailed treehouse support and they apologised for confusion with the old tutorials and they said they are planning on updating everything so that it will work with rails 4.1.