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

Anders Lund
Anders Lund
3,061 Points

NoMethodError in Statuses#new

I get this when I try to create a new status? Don't know why, help!

NoMethodError in Statuses#new Showing /Users/anderslund/mivibox/app/views/statuses/_form.html.erb where line #16 raised:

undefined method `name' for #<Status:0x007f89ce50fde8> Extracted source (around line #16): 13 14 15 16 17 18 19

 <div class="field">
   <%= f.label :name %><br>
   <%= f.text_field :name %>
 </div>
 <div class="field">
   <%= f.label :content %><br>

Trace of template inclusion: app/views/statuses/new.html.erb

Rails.root: /Users/anderslund/mivibox

Application Trace | Framework Trace | Full Trace app/views/statuses/form.html.erb:16:in `block in _app_views_statusesform_html_erb3807573283266651346_70114936884460' app/views/statuses/_form.html.erb:1:in `_app_views_statusesform_html_erb3807573283266651346_70114936884460' app/views/statuses/new.html.erb:3:in `_app_views_statuses_new_html_erb__2979864427152061757_70114936825620'

2 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Can you show the whole new.html.erb and the form.html.erb? Is your form a partial (with _ at the beginning of the name)? You can also show the statuses controller and model just in case ;). And your gemfile.

Anders Lund
Anders Lund
3,061 Points

I started from the top again to see if I can find the problem while creating the site. but thanks anyway