Meet HelpDesk

On the right side of the screen, you can see a running Rails application — HelpDesk, a support ticket management system you’ll be working with throughout the tutorial.

The app has three user roles:

UserRoleDescription
AliceCustomerSubmits and tracks support tickets
BobAgentHandles and responds to tickets
CharlieAdminFull access to manage everything

Try it out

Launch the Rails server:

Terminal window
$ bin/rails s

Sign in using one of the quick login links (or use the credentials below):

EmailPasswordRole
alice@example.orgs3cr3tCustomer
bob@example.orgs3cr3tAgent
charlie@example.orgs3cr3tAdmin

After signing in, you’ll be redirected to the Tickets page. Try creating a ticket, adding a comment, or editing existing ones.

Notice something?

Right now, every user can do everything — any user can edit or delete any ticket, read internal comments, and assign agents. There are no access controls in place (check out the file).

That’s exactly the problem we’ll solve in this tutorial using Action Policy.

Using the terminal

You can also interact with the app through the terminal below the preview. Try opening a Rails console:

Terminal window
$ bin/rails console

Try listing users with their roles:

helpdesk(dev)> User.pluck(:name, :role)

Running tests

You can run Rails tests from the terminal as usual. For example, run the TicketsController integration tests:

Terminal window
$ bin/rails test test/integration/tickets_test.rb
Powered by WebContainers
Files
Preparing Environment
  • Preparing Ruby runtime
  • Prepare development database