Extending this logic to the `Resubscriptions` controller, you may find something like
```
subscription = current_company.stripe_customer.subscriptions.first
Stripe::Subscription.update(
subscription.id,
{
cancel_at_period_end: false
}
)
```
This is a great episode! The Lockbox gem recently added support for Action Text Rich Text snippets to encrypt them. ☒ would it be possible to restore a version of an article record? Basecamp does something similar to this episode, where a Document has many Document::Version and the user can see an updated view of all the changes that have happened to the document. For restoring a version, you can open up a Document::Version and click a button to "Make this the current version."
I think it wouldn't justify it's own controller, and `restore` could be an action on the `Document::VersionsController`. The route might look like this, but I'm not sure what the logic in that method would look like.
# config/routes.rb
resources :articles do
scope module: 'articles' do
resources :versions do
post :restore, on: :member
end
end
☒ well said, and I agree with those points. Have you an idea what the logic in the RestoreController might look like to allow a user to "restore" a prior version to "Make this the current version."?
This is a great tutorial David! Easy way to present users with a pre-configured dashboard.
How would you extend the ability to allow a User to further customize the dashboard widgets? i.e a User can go into their dashboard to reorder and reconfigure modules with dragging and dropping, add widgets etc.