Skip to content

Instantly share code, notes, and snippets.

@mhenrixon
Created March 2, 2011 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhenrixon/851652 to your computer and use it in GitHub Desktop.
Save mhenrixon/851652 to your computer and use it in GitHub Desktop.
the c# way of doing if statements
if ((order.status != :created) and !(User.Current.IsInRole("Admin")
{
ViewBag.Alert = "This order cannot be changed since work has begun;
Response.Redirect(string.Format("/Orders/", order.Id);
}
unless current_user.has_role?(:admin) or @order.status == :created
redirect_to @order, :alert => "This order cannot be changed since work has begun"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment