This is a simple and straightforward task, and should not take long. I have not included an NDA, since revealing details on this project do not matter. Treat the project with professionalism just as you would an NDA project.
The Ruby on Rails application provided contains three models, User in user.rb, Source in source.rb, and Subscription in subscription.rb. A User is straightforward, it is a user. A Source is an object that contains a website's name, its RSS link, and its homepage. A Subscription is an object that is connected to both User and Source. It describes the relationship that a User can have a Subscription to a Source via its RSS link. Each user can have many Subscriptions. All the relationships are built. I have provided sample data that will need to be generated as follows. Once the database is ready, run these three tasks:
1. script/runner 'Source.create_source'
2. script/runner 'User.create_user'
3. script/runner 'Subscription.create_subscription'
Number 1 creates 20 Sources along with their name, RSS link, and homepage from sources.txt in the models folder. An associated User called a "shill_user" is also created. This is a User with only one Subscription, the Source with which it is associated. A shill_user also has one shilled_source, so it is bidirectional. Regular Users do not have a shilled_source.
Number 2 creates creates 10 Users.
Number 3 creates up to 10 random Subscriptions for each User, unless the User has a shilled_source.
The project itself consists of just one task:
Using the Ruby on Rails application provided, for a given User, create a view and associated controller that will display all Sources in alphabetical order in one column, and check boxes corresponding to each Source in one column. When the view is loaded in the browser, the given User's existing Subscriptions will show up as a check in the check boxes for the corresponding Source. The other check boxes will not be checked, since the User does not have a Subscription to the corresponding Source. The User can then edit his Subscriptions by checking or unchecking the check box for the corresponding Source. There is a button at the bottom of the page, which when clicked, will save the changes to the User's Subscriptions. When the button is clicked, if the box is checked, it will find_or_create a Subscription by the User's id and the check box's corresponding Source. When the button is clicked, if the box is unchecked, it will delete the Subscription if it exists in the database.
I have included three screenshots of what the view should look like:
List of all sources.png
This is a view that shows all Sources in the database.
List of user's subscriptions.png
This is a view of User 21's list of Subscriptions.
List of all sources and user's subscriptions.png
This is a view of what the final result should look like. It shows all the Sources in the database in alphabetical order, but at the same time it checks only those which are in User 21's list of Subscriptions. Once again, the User is able to check or uncheck the Sources, and click the button at the bottom of the page. This will either save the Subscription, or delete the Subscription (or none if no change to the check box.)
Contact me if you have any questions.