0
저는 루비 1.8.7과 레일 3.2.13을 사용하고 있습니다. formtastic을 사용하여 양식을 만들고 싶습니다. 나는 "NilClass : Class"에 대한 정의되지 않은 메소드`model_name '을 계속 오류로 처리합니다.Formtastic undefined method
App_pages_controller.rb : 다음은 내 컨트롤러, 경로 및 인덱스
class AppPagesController < ApplicationController
def index
end
def new
@person = Person.new
end
def create
@person = Person.new(params[:person])
if @person.save
redirect_to new_student_path
end
end
def registration
end
def unknown
end
end
routes.rb :
WyspApp::Application.routes.draw do
resources :persons
match '/registration', :to => 'App_pages#registration'
match '/unknown', :to => 'App_pages#unknown'
match '/index', :to => 'App_pages#index'
root :to => 'App_pages#index'
index.html.erb
<%= semantic_form_for @person do |form| %>
<%= form.inputs do %>
<%= form.input :name %>
<%= form.input :born_on, :start_year => 1997 %>
<%= form.input :description, :as => :text %>
<%= form.input :female, :as => :radio, :label => "Gender", :collection => [["Male", false], ["Female", true]] %>
<% end %>
<%= form.actions do %>
<%= form.action :submit, :as => :button %>
<% end %>
<% end %>
어떤 도움 대단히 감사합니다! 미리 감사드립니다.