Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created November 30, 2012 21:03
Show Gist options
  • Save leejarvis/4178588 to your computer and use it in GitHub Desktop.
Save leejarvis/4178588 to your computer and use it in GitHub Desktop.
class UsersController < W::Controller
permit_attributes :name, :email
def index
@users = User.order('created_at DESC')
end
def new
@user = User.new
end
def create(attributes)
@user = User.new(attributes)
end
def show(id)
@user = User.find(id)
end
def edit(id)
@user = User.find(id)
end
def update(id, attributes)
@user = User.find(id)
@user.update_attributes(attributes)
end
def destroy(id)
@user = User.find(id)
@user.destroy
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment