Hi! Thanks for your interest in joining the team. This README will guide you through completing our interview application. While completing this application, you'll get a bit of exposure to testing and completing a basic Rails controller.
The app doesn't do much now, and has failing tests. Your job is to complete the application such that the views are populated with data, the tests pass, and all requested functionality is completed.
After that you'll get the chance to show us how you'd implement the same functionality in JavaScript if you were tasked with building a single-page application.
Have fun with the challenge! When you're done, please link your contact person to your forked repository on GitHub.
- Ensure you have version
2.3
or higher ofruby
installed on your machine. - Ensure you have
bundler
installed (gem install bundler
) - Ensure you have
git
installed on your machine
- Fork the rails-interview repository on GitHub.
clone
it locally to your machine- When done, push your changes up to your fork
If you are unfamiliar with forking, follow these instructions
cd
into the directory- Run
bundle install
to install gems - Run
bin\rails server
- Browse to http://localhost:3000
This will run the tests as defined and report any errors making use of predefined fixtures.
We have given you some failing tests to try to fix. We've also provided you with some predefined fixture data to utilize. As you implement your Rails controller, you'll see the tests start to turn green.
You can run the tests by running
rake test
from the command line in the application directory.
Once all of your tests are passing, please move on to the JavaScript portion of the application.
Once you've completed the Rails portion of the application, you then get to use a bit of creativity to implement that same page, but in JavaScript as a single-page application. You may use any of the following frameworks:
- Backbone with or without Marionette
- AngularJS 1.x
- ReactJS
We have several JavaScript applications in production with a few different frameworks, so this part is important to us. Structure this JS application in a way that you find simple and easy to understand.
You may utilize a Rails view to load the header of the page, an entry point
DOM element, any JS templates
(ex. <script type="text/template" id="someTpl">DOM TEMPLATE IN HERE</script>
)
and any extra JavaScript files you need to load. All templates should be
loaded from the JavaScript side, not rendered by Rails.
- Allow
/students
to return JSON using headers. (Don't use/students.json
) - Add a nested collection route named
:js
to the:students
resource - Create a corresponding
js
method in theStudentsController
- Return a view from
/students/js
that will load a single-page application version of/students
and fulfill the constraints listed above. - SPA should only load everything below the
h1
header with front-end views - The JavaScript code should trigger the rendering of the rest of the page.
- SPA should have all functionality of
/students
with:
- Sorting by clicking on table headers
- Filtering by name with a text input just above the table
- SPA should only make JSON AJAX calls to
/students
- Must use Promises (native, jQuery, $q, etc) for AJAX requests
- Must implement successful case when API responds properly
- Must implement unsuccessful case when API fails to respond
We will be grading your interviews on a number of different criteria, but here are some things to keep in mind.
- We prefer readable code over clever code
- We will be inspecting your commits independently
- We like explanations in commits for why things were changed
- We like separation of concerns (data, presentation, controls)
Did you make it this far? Good! We want to make sure you're paying attention.
Make a POST
route for /foo
point to any controller and action.
Inside that route, if a parameter named valid
is present with the string true
,
you should return only the text BAR
with a 202
status code.
If the parameter is not present in the POST
body or it is not the string
true
, raise an exception.
Thanks!