Displaying 1 result from an estimated 1 matches for "ad_hour".
2006 Mar 05
3
Trying to connect tables .....
...while evaluating nil.user_id"
I''ve included the model for both AdHour and Ad.
Why doesn''t the script like how I am connecting the tables??
Thank you!
----------------------------------------------------------------
def edit
userid = @session[:user].id
@ad_hour = AdHour.find(@params[:id])
***** if (@ad_hour.Ad.user_id != userid)*****
render_text "You do not have permission to modify this ad." and
return
end
end
class AdHour < ActiveRecord::Base
belongs_to :ad
end
class Ad < ActiveRecord::Base
has_one...