Thinking in Rails – Part 1

Part 0

In this part we look at the basic set of requirements for our text editor. I have no doubt that these requirements will change, but let’s have a quick look to get an idea of the direction we are heading in.

Text Editor Requirements

As mentioned in part 0, the text editor is going to be a very basic editor. It will maintain a version history that will allow users to roll back to a previous version of a document. This requirement is what will make this task interesting and worthwhile.

We would like to end up with screens similar to this:

The documents index page:

Clicking ‘show’ will show the related document and give the user an option to edit it.

Clicking ‘edit’ will show a form that allows the user to edit the document. When the user clicks ‘save’, the application creates a new version, without overwriting existing versions.
We will be providing this behaviour with a slight ‘twist of hand’. I will come back to this point when we actually implement it.

Clicking ‘delete’ will completely remove the document and all its versions – this is not a roll back.

If the user clicks on ‘History’ on ‘Second one’. We expect to see a screen similar to this:

Clicking ‘show’ will show the relevant version.
Clicking ‘rollback’ will delete the latest version, thus rolling back to the previous version – this is deleting one version only, not the entire document.

What is next?

Next we will have a quick look at the database schema and then we finally move onto Rails code! We will not be using the scaffolding features of Ruby on Rails. We will create our application from the ground up – generating models, controllers and views independently. We will also be coding using TDD. If you are new to Rails, I am sure you will enjoy the upcoming posts.

7 Responses to “Thinking in Rails – Part 1”

  1. Thinking in Rails – Part 0 « Project Entropy Says:

    [...] Thinking in Rails – Part 0 Part 1 [...]

  2. Tom Says:

    Daryn,

    Thank you so much for addressing the Save As question. I eagerly await your solution.

  3. m3tasmith Says:

    This reminds me of a file upload system I made for a client so far; complete with versioning. I look forward to seeing how you are going to approach this.

  4. Marco Mangiante Says:

    Hello,

    is there a part two in the future?


    Regards,

    Marco Mangiante

  5. darynholmes Says:

    Hi Marco,

    I have been a bit overloaded at work. I will try to get out part 2 soon.

    Apologise for the long wait…

  6. skob Says:

    hi
    are you still working on this tutorial?
    i would like to read more, as your tutorials are really great.

  7. ReZa Says:

    Same Here, I am looking forward for part 2, Thanks

Leave a Reply