[Rails] Re: Problem while creating a new record
NoMethodError in Vorlesungs#new
Showing /home/babak/Management/app/views/vorlesungs/new.erb where line
#1 raised:
undefined method `vorlesungs_path' for #<#<Class:0xb6009cfc>:0xb6008f3c>
Extracted source (around line #1):
1: <%= form_for @vorlesung do |v| %>
2: Name : <%= v.text_field :Name %> <br>
3: Name de Professur : <%= v.text_field :Leiter_name %><br>
4: <%= v.submit 'Speicher'%>
Rails.root: /home/babak/Management
this error occured when my new.html.erb is:
<%= form_for @vorlesung do |v| %>
Name : <%= v.text_field :Name %> <br>
Name de Professur : <%= v.text_field :Leiter_name %><br>
<%= v.submit 'Speicher'%>
<% end %>
and my controller is:
class VorlesungsController < ApplicationController
def new
@vorlesung=Vorlesung.new
end
def create
@vorlesung=Vorlesung.create(params[:vorlesung])
if @vorlesung.save
@status_message = 'Student inserted successfully.'
else
render 'new'
end
end
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home