Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # in controller action:
- def show
- @movie = Movie.find_by_id(params[:id]) # what if this movie not in DB?
- # BUG: we should check @movie for validity here!
- end
- -# ...later, in the Haml view:
- %h1= @movie.title
- -# will give "undefined method 'title' for nil:NilClass" if @movie is nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement