Rails console commands

You really need to learn about rails and not directly modify that database. What I did was find a rails book and read it. And at some point I also looked at a Ruby book. I’m old enough to remember when books were the only way to learn about computers. As I understand it, there are many sites on the internet that can give you a Rails tutorial. I think that there is a way that you can search the internet to find them.

Here is one that I found

Here’s how to update stuff with rails, but reading one of those guides will quickly give you an idea of how it works.

t=Topic.find(123)
t.title='my new title'
t.save

# or
t.update(title: 'my new title') 

When you do stuff through Rails it does a bunch of checks if stuff. These things will usually keep you from making huge mistakes. You probably shouldn’t break those rules until you understand them.

For example, if you want users to create topics in a certain category via the API, then they need to have rights to create a topic in that category. If you really want to have a topic created by a user to exist in a category he doesn’t have rights to, then create it if another category and then have an admin move it (or do it via rails, which won’t enforce category permissions).