Hi experts
I tried to save data in my Database in RoR but i could not do that.No
Error occured but i had no success to save data.hier is my codes:
in my Controller:

class VorlesungsController < ApplicationController
  def new
         @vr=Vorlesung.new
  end

  def create
    @vorlesung=Vorlesung.create(params[:vr])
    if @vorlesung.save
      flash[:notice]='ABC'
      render :action => 'index'
    else
      flash[:notice]='DEF '
      render :action => 'index'
    end
  end
end

My View:

<%= form_for :vorlesung do |v| %>
    Name : <%= v.text_field :Name %>    <br>
    Name de Professur : <%= v.text_field :Leiter_name %><br>
    <%= v.submit 'Speicher'%>

<% end %>


i think that my Form_for is not in correct form because when i delete
create function from the controller everythings is as before and when i
changed :vorlesung in Form_for to @vr an error occured :
                              NoMethodError in Vorlesungs#new
Thank you for your help

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to