I'm dealing with a basic one to many relation where I'm deleting a record on the many side. The models are "places" and "search_terms" where places has_many search_terms. When I create a new record, the view is updated and the new search_term appended to the list. However, when I delete a search_term record the view is not refreshed even though it deletes the record and runs the "show" method for Place.
I'm quite new to rails 3 so can't really figure out whats going on here...
Cheers, Gearoid.
Edit: the search_terms controller destroy method:
def destroy
@search_term = SearchTerm.find(params[:id])
@search_term.destroy
@place = Place.find(params[:place_id])
redirect_to place_path(@place)
end
The places controller show method:
def show
@place = Place.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @place }
end
end