I'm trying to pass the parameter of the current page(id) to the next page so I can create a dependent model entry.
i.e. Projects have bids, bids belong to projects.
So on the show page for a project I added the link
<%= link_to "New Bid", new_bid_path(@project) %>
Which creates and performs the url.... "http://localhost:3000/bids/new.2"
I have
def new
@bid = Bid.new
@project = Project.find(params[:id])
end
in the bids controller but I keep getting the error "Couldn't find Project without an ID"
???
Whats going on, how come I can't pass the id?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…