Permalinks
Posted in Ruby on Rails, Web DesignA permalink is an attribute of a Story, so we’ll need to modify our schema so that one can be stored for each story. We’ve already seen migrations in action each of our existing migrations was generated when we created a new model. Now we need to expand an existing model, so that we can add a permalink attribute to the Story model.
To add a migration without adding a new model, we use the generate script, passing migration as the first parameter:
$ ruby script/generate migration AddPermalinkToStories
(more…)
