On 27 January 2016 at 18:54, Bob Tian <lists@ruby-forum.com> wrote:
> Hello, thanks to you I have been able to add in the data. I also changed
> and cleaned up the code and used the convention with regards to the
> variables. I have another question regarding the destroy/deleting data,
> when I click on delete, it directs me to show where i can view the data,
> but does not delete anything. Here is my updated code
Look in log/development.log and when you click delete you should see
the request and whether it is calling the destroy method. You can
insert diagnostic code in your methods using stuff like
def destroy
logger.info "In destroy"
@person = Person.find(params[:id])
logger.info @person.inspect
@person.destroy
redirect_to :action => :index
end
and your logger output will appear in the log file.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsx4AOLGVYts%3DiwJx2CUOsTC-wTe%3DxxmJGzGJ_HaDkhEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment