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 Rails Routes and Resources Routes to Update Actions An Update Action

Andrei Burichita
Andrei Burichita
9,989 Points

i am getting an: NoMethodError in Pages#edit after creating the _form.html.erb and updating edit and new erb files

i ended up in copying the exercise files and i still get the above mentioned error. :( i can not edit or add new entries to the blog after creating the _form.html.erb.

Andrei Burichita
Andrei Burichita
9,989 Points

undefined method `page_path' for #<#<Class:0x007fc2953d1968>:0x007fc29b14bc88>

Did you mean? pages_path image_path

Extracted source (around line #1):

1 <%= form_for(page) do |f| %>

2 <div class="field">

3 <%= f.label :title %>

4 <%= f.text_field :title %>

5 </div>

Trace of template inclusion: app/views/pages/edit.html.erb

2 Answers

Andrei Burichita
Andrei Burichita
9,989 Points

if I in the _form.html file change from <%= form_for(page) do |f| %> --- to --- <%= form_for('page') do |f| %> then i can enter the edit link but saving does not occur... I am really stuck here :|

Andrei Burichita
Andrei Burichita
9,989 Points

Nevermind....case closed...i had to re do the whole chapter just to see where i did my mistake...case closed...