dimanche 13 août 2017

I have a cloud 9 error while running the app in cloud 9

when I run my app I get this error :

(NoMethodError in Articles#new Showing /home/ubuntu/workspace/yappy/qaucky/app/views/articles/new.html.erb where line #3 raised:

undefined method `model_name' for # Extracted source (around line #3): 1

Create an article

2 3<%= form_for @article do |f| %> 4 5 6<% end %>

this is the image (http://ift.tt/2fDtLYQ)

Rails.root: /home/ubuntu/workspace/yappy/qaucky)

resources :articles

root 'pages#home'
get 'about', to: 'pages#about'

my new.html.erb file:

 <h1>Create an article</h1>
<%= form_for @article do |f| %>
<% end %>

my articles controller file: class ArticlesController < ApplicationController

def new

@article = Article.new 

end





end 

my article.rb file :

class Article 


end

my routes.rb file :

Rails.application.routes.draw do
# The priority is based upon order of creation: first created -> highest 
priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
resources :articles  

root 'pages#home'
get 'about', to: 'pages#about'

# Example of regular route:
#   get 'products/:id' => 'catalog#view'

Aucun commentaire:

Enregistrer un commentaire