Hello again Roy I was wondering - does it make any difference that I use render :action => 'show' rather than redirect_to :action => 'show' in the def create action? Thanks again and again
I suspect it doesn't matter, but am not sure. The scaffold-generated code (for version 2.0.2, which is what I'm using) does a redirect_to, but I don't know what informs that choice.
Ach--okay. I didn't realize debug wasn't available in a controller--sorry about that. But no matter--rails' stock error handling echoed the params anyway--I think we know now that your link_to call is successfully moving the call_id. So now we look at the next step in the chain--your visits/new view. You've got to include the call_id attribute somewhere in your form, so that when it gets posted back to the server, it (again) gets stuffed into the params, so your VisitsController.create method can stuff it into the database.
Looking at the view code you posted earlier in the thread, I'm not seeing a reference to the call_id. So--within your form_for ... end block throw in a:
<%= f.text_field :call_id %>
That will actually show the call_id attribute--verify that it's getting the value you want. If that fixes your problem (and I suspect it will) then you can change that to
<%= f.hidden_field :call_id %>
And then it won't be shown to the user, but it will still be part of the form.
Hello Roy and Good MOrning
Thank YOU so Much!!! That worked - I figured that the id wasn't getting passed but I didn't know why. I owe you a deep sense of gratitude and I wish there was a way I could at least buy you a BEER or something. Your time and effort are much appreciated. Let me Know
Thanks again -Owen Madden I'll be gone now for a few hours