RESTful API CHALLENGE
As a user, so I can save milliseconds of my time, I want to be able to:
> post messages
> see them appear
> edit them
> and delete them.
All without reloading or refreshing the page (also should be stored to view at a later date).
- fork this repository
git clonethis to your projects foldercdinto the folder- run
bundle
To set up a local database:
- Install
homebrewand then install PostgreSQL - Follow this quick setup if unfamiliar.
- Run
psqlfrom the command line to access your databases (or however else you do so) and make sure toCREATE DATABASE message_board_development;so that data DataMapper has somewhere to map the model to.
This sets up the models since the dm_set_up file has now run.
- Migrate the data (empty at this point) in order to create the table.
> rake db:auto_migrate- Ruby on Sinatra (Modular) with DataMapper
- PostgreSQL Database
- Javascript
- AJAX with JSON
- No page reloading or refreshing.
- Using AJAX calls:
- Messages can be created. And are saved in database immediately.
- Messages can be read. Created messages are retrieved and shown on page at the top immediately.
- Messages can be edited. Updates are saved and displayed automatically
- Messages can be deleted. Results shown immediately.
- Create, edit, and delete buttons with event listeners.