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 Create Actions Controller Action to Create Pages

NoMethodError in PagesController#create

undefined method ` ' for #<PagesController:0x007fdc0db572c8>

Extracted source (around line #16): 14 15 16 17 18 19

  def create
    page_params = params.require(:page).permit(:title, :body, :slug)
    @page = Page.new(page_params)
    @page.save
    redirect_to @page
  end

Hi there,

Can you post the whole controller and highlight which line is #16?

Steve.

Hi Steve,

I am not sure exactly what happen, but I re ran the app, and now I am not receiving the error message.

1 Answer

It happens. I find, if I run into any weird errors, that restarting the server can fix them. I always do that before worrying further about the problem!