RailsCasts Pro episodes are now free!

Learn more or hide this

Xaver's Profile

GitHub User: Xaver

Site: http://www.xaver.com.ar

Comments by Xaver

Avatar
ruby
class ThingsController < ApplicationController
  def show
    @thing = Thing.find(:id)
    if @thing.user != current_user && @thing.is_private?
      raise ActiveRecord::RecordNotFound
    end
  end
end