The parameters are appended on the original URL
(…/projects/show/559). Why is the previous id still showing?
The whole “project id = 673” and “commit = go” are present. I just
want the id number as shown above.
Help! This is driving me mad. Any help much appreciated for a rails
newbie!
Thanks
Nick
Nick, I’m a newbie too, but I find that sometimes if I give a stupid
answer, it ruffles the feathers of an expert enough that they chime in
with the right answer.
I would try using session[:project_id] to keep track of your id. You
have to set it somewhere where it is known, and then it should be
available from pretty much anywhere. You can’t count on a global to
keep the right value between updates.
sorry, no clue on this one…leaving out “:id => @project.id” will
get you closer, but I don’t know how to get rid of the commit part.
I would try using session[:project_id] to keep track of your id. You
have to set it somewhere where it is known, and then it should be
available from pretty much anywhere. You can’t count on a global to
keep the right value between updates.
Yes, I could use the session to hold project.id. I thought (!) it would
be simpler just to post it in the url. This is a good application of
“GET” requests, since it does not change the page and users can bookmark
it.
sorry, no clue on this one…leaving out “:id => @project.id” will
get you closer, but I don’t know how to get rid of the commit part.
Leaving out “:id…” doesn’t make any difference.
Another observation:
The generated html for a typical page is:
...
So I can see that it thinks the action is “/projects/show/559” and not
“projects/show” - weird!
Thanks again
nick
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.