Welcome Guest | Login

Update Question

Ok I have my from all set http://682csudh.augustine.hostingrails.com/), the keys and links work BUT
when I go to edit, it tells me that it has updated but the entry's do not change.

I assume the error is either in the controller or in my definition,but they seem right
Here is the controller text:
class StudentController < ApplicationController
scaffold :student
def list
 @students = Student.find_all

end
def delete
Student.find(@params['id']).destroy
redirect_to :action => 'list'
end
def edit
@Student=Student.find(@params['id'])

end

end
and the rhtml :

<td><%=link_to student.id,:action => "edit", :id => student.id  %></td>

2007-01-15 12:28 PM

Hi there
with this
def edit
@Student=Student.find(@params['id'])

end
It doesn't look like much is going on in there....what do you want to 'edit' about your @student ?

2007-01-15 06:57 PM

I want to edit the lastname, first name, info, url and email fields in my entry

Do I have to declare that, but how?

2007-01-15 07:52 PM

Take a look at what happens for the controller that is created when you do a scaffold:

ruby scripts/generate scaffold Themodel Thecontroller

In Thecontroller you'll see how the 'edit' is setup - and in views you'll see how the fields are setup the Rails way :)  That should help you out the best.  

2007-01-15 08:09 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.