I have an odd issue that I am having a difficult time solving.
When I attempt to create or edit data in my rails app; it INSERTs NULL
values instead of the values I eintered in the form. Same with editing
the data; it doesn't UPDATE the table with values I entered. Via the
console, I can see that it recieved the values but the SQL statements
show NULL values.
I don't know where my problem lies. Here's my code below. Any help
would be greatly appreciated. Thanks!
when using formfor, the returned parameter's name is the same as the
model's name, but in your create action you are retrieving "meetmes"
instead of "meetme" from the parameters (which is nil) so the new
method would instantiate an empty model and then try to save it.
try this create action instead of the one you have:
def create
@meetme = Meetme.new(params[:meetme]) # notice this line
respond_to do |format|
if @meetme.save
flash[:notice] = 'Meetmes was successfully created.'
format.html { redirect_to(@meetme) }
format.xml { render :xml => @meetme, :status
=> :created, :location => @meetme }
else
format.html { render :action => "new" }
format.xml { render :xml => @meetme.errors, :status
=> :unprocessable_entity }
end
end
end