Displaying 1 result from an estimated 1 matches for "unknown_product".
2007 Jul 31
2
controller exceptions
...# views/exceptions/admin_access_required.rhtml
end
end
end
If the user is logged in but does not have administrative access, this
will render a page describing the problem with the proper HTTP status
code 401.
The UnknownProduct exception might look like this:
# dist/app/exceptions/unknown_product.rb
class UnknownProduct < Merb::ControllerExceptions::NotFound
def action
@id = params[:id]
render # views/exceptions/unknown_product.rhtml
end
end
If passed a bad id, the server will respond with 404 and a page that
is specific to missing a product.
The advantages of t...