Newbie to Rails here, I was wondering if there is a tool which can be used to represent relationships using drag drop like MySQL WorkBench(image below) and can generate model automatically for us along with relations.
(source: packtpub.com)
I think it would be a great tool to have but its surprising to find none available from quick search, is there some huge disadvantage for creating models this way?
To tersely answer your question, no, I don't know of any that directly interface with rails. But if you just want to see the relationships between models, you could play around with gems like Graphviz and RailRoad.
While I'm sure you could use something like MySQL Workbench to mess with tables used by a Rails app, the Migration features of rails are very quick, effective and integrated with your app.
Syntax for generating models and updating table attributes is available in the Ruby on Rails Guides
For example, if you want to create a user table, it's just a few keystrokes away:
rails generate model User user_name:string password:string favorite_food:string lucky_number:integer vegan:boolean
If you ever decide you want to add/remove/change a column, you can do something like:
rails g migration AddStudentIdtoUsers student_id:integer
rails g migration RemoveVeganfromUsers vegan:boolean
You can even go edit these proposed changes before you implement them if you want. Then you would run rake db:migrate
to actually implement the changes you've laid out.
Moral of the story, give the CLI a chance. Spend less time messing with SQL and more time building your app.