Advanced Ruby on Rails database? - ruby-on-rails

Im taking on an upcoming project that involved creating and managine a large complex mysql database using RoR. It involved, many table, deep foreign keys, many to many, etc.
Anyone know a good resource (book, website, etc.) which can help me learn how to do it? I need a clearer understanding of migrations and how rails handles relational databases.
Any suggestions?

railscasts.com is great. He talks a lot about setting up your typical HABTM relations polymorphic associations, inner nestings you name it. and Bates makes it extra easy to understand.
Past that I would definately try to start off on the right food using the Metrics gem to monitor database and CPU usage. Always ensuring you're making the lightest touch on the db.

Besides RailsCast, I would recommend RailsLab: Scaling Rails which focus on large Rails application. It seems doesn't update recently, but the post still useful, not only database, but also memory, performance etc.

+1 for Railscasts.com suggestion from Trip. I've gotten a ton out of those since I moved to Ruby and Rails from ColdFusion. I also like the book "The Rails 3 Way" from Obie Fernandez. It has an extensive ActiveRecord section that is very informative both for new Rails users and is a great reference. Another solid one is "Rails 3 In Action" from Ryan BIgg and Yehuda Katz.

You can check out books at the Pragmatic Programmers website. Probably one of the best options is: Agile Web Development with Rails
I also found Ruby on Rails Tutorial to be a good resource.
Also be sure to look at the Rails Guides They are well written and cover many topics in depth. For example, the migrations you mentioned and many to many associations You can even download them for offline use. Here is an answer about how to do that here

Code School have some great interactive courses such as Rails for Zombies.

Related

CodeSchool: Rails Best Practices

Hey guys I wanted to know if anyone has purchased this Rails course and what you think of it?
The reason I'm asking is because I'm fairly new at rails and I'm still trying to wrap my ahead around certain things.
Any other advice regarding where to find active blog posts about rails would be greatly appreciated as well.
I'm in a similar position, though have not purchased the rails course you linked.
That said This Book (Agile Web Development with Rails) has been a godsend - and many others in the rails community have said this is the 'go-to' book so I'd suggest giving it a look :)
Iv'e Completed most of the courses at codeschool to date. They are all pretty good to excellent. Especially the rails & ruby courses. Good for beginners & go into good depth too. Can't recommend them enough. Definitely worth the money. Subscribe, its $20 a month if you complete a course. No i don't work for them. : )
I would highly recommend taking a look at Michael Hartl's Rails Tutorial. The book is online for free, updated frequently, and the related paid screencasts are well worth the money. It won't just teach you Rails best practices, but also best practices as a developer using Ruby on Rails to craft web apps (eg Test-Driven Development, version control, deployment etc). I love the Agile Web Development with Rails book mentioned (it was my intro to Rails, too) but I believe I got more value out of Rails Tutorial.
Edit: I should probably add that Code School are awesome and I have done the course mentioned by #imjp. I thought it was worth the money, for sure.
Instead of purchasing it, you could just subscribe to their newsletter,
Due to the fact that their service is new, they offer all the courses FOR FREE very often.
It's a great course for ruby newbies, and a great site overall!

Would Ruby on Rails suit my work..?

I wanted to make a web site with the following basic features- (1)User registration for buyers and sellers. (2)profile pages (3)A buyer should be able to post work and should get profile links of the corresponding seller who has expertise in that work.
As time progresses i would want to add more features to the site.The freelancer sites where user can post jobs and get bids is the best example of the work.
(1)I want my code to be maintainable as i woud be adding features later on. (2)It should be quick to develop. (3)Resources should be available(not the entire thing, atleast in bits and pieces) for the above requirements and should not be tough to find for future enhancements. (4)Design should be decoupled from the buisness logic as i would outsource the design work.
I was thinking of Ruby on Rails for this work as i have experience in the MVC model and RoR looks cool.I am from the mobility domain so i don't know whether RoR will suit my work
Would RoR suit this purpose.If yes where can i find the resources to the above mentioned requirements.
Thanks
Ruby on Rails would be ideal for this type of website.
Check out some of these resources for info on how to use Ruby on Rails:
http://guides.rubyonrails.org/
http://railscasts.com/
http://www.railsforum.com/
I noticed you are already aware of TeachMeToCode, but there is a tag there for all the Rails 3 tutorials, with some blog tutorials and what looks like the beginning of a series on how to build a del.icio.us clone. Since they are in Rails 3, they would be well worth checking out:
http://teachmetocode.com/screencasts/tag/rails-3/
One of the best tutorials:
http://railsforzombies.org
It will let you have your own point of view quickly.
It depends on with which languages you have experience. Any good MVC framework will do the job just fine but if you like Ruby syntax RoR is definitely a good framework to develop this kind of application.

Getting Started: Learning RoR for a ASP.Net MVC/C# Developer

I am an ASP.Net MVC / C# developer looking to get started with Ruby on Rails. Could you point me out to any books / tutorials which would help jump ships quickly.
I am familiar with MVC, Castle Active Record and jquery.
Thanks
Having just gone through this and looking for the best ways to learn ruby and rails I found the following most useful:
http://pragprog.com/titles/rails4/agile-web-development-with-rails (covers Rails 3)
I found this a good starting place to go through the basics of rails and while reading this I was able to follow along and build the application.
http://guides.rubyonrails.org/
Instead of building an application you get the vertical view of rails - i.e., sections to understand models, caching, views, layouts, etc. This is a great resource to follow along and read the sections you are dealing with.
http://www.railscasts.com
As you come across something you need to implement - e.g., many to many relationships this site provides some great examples and walkthroughs.
As a C# developer you may be slightly confused by Ruby. Here are the sites I recommend for learning Ruby:
http://www.fincher.org/tips/Languages/Ruby/
Although not formatted great - I found this one very useful to get the gist of Ruby syntax.
http://www.ruby-lang.org/en/documentation/quickstart/
Another great easy to follow tutorial
Lastly just try out some code.
Good luck!
I enjoyed Ruby on Rails for .NET Developers
How quick you can jump ships is really dependent on how fast you pick up the Ruby language and a new IDE. If you already know MVC and ActiveRecord you'll probably fly right along.
Heroku is really really really cool. Definitely try it out.
Welcome to the rails world :) !
Here is some links that may interest you :
There is a fun way to learn : railsforzombies.org
You can watch great screencast at : railscasts.com
You can find a free book here it is very complete : railstutorial.org/ruby-on-rails-tutorial-book
I also found this : www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials
There should be a lot more.
Have fun !
Ya right of now Ruby on Rails 3 is so proper among RoR developer. so get update on it.
Beginning Rails 3 - http://apress.com/book/view/9781430224334
Agile web development Rails 3 - http://pragprog.com/titles/rails4/agile-web-development-with-rails
These two books are rocking new learning and making a step on RoR.
and if u want video tutorial,
go for Railscasts and Teachmecode

Process for beginning a Ruby on Rails project

I'm about to begin a Ruby on Rails project and I'd love to hear how others go through the process of starting an application design. I have quite a bit of experience with RoR, but don't have that many starting from scratch with only a vision experiences and would appreciate the wisdom of others who've been there.
I'm looking for an order of events, reasons for the order, and maybe why each part is important. I can think of a few starting points, but I'm not sure where it's best to begin
Model design and relationships (entities, how they relate, and their attributes)
Think of user use-cases (or story-boards) and implement the minimum to get these done
Create Model unit-tests then create the necessary migrations and AR models to get the tests to pass
Hack out the most basic version of the simplest part of your application and go from there
Start with a template for a rails app (like http://github.com/thoughtbot/suspenders)
Do the boring gruntwork first (User auth, session management, ...)
...
I found myself looping the following tasks for most projects:
Gather User requirements
Design database Models
Build Views
Streamline Layouts
Find and learn Plug-ins/Gems
Testing
User Review/Acceptance
Deploy the app
Documentation
After these years of working as a freelancer, I think step 1 and 2 are the most important (at least for small projects). Before writing any code, I urge users to finalize all UI first. HTML skeleton is better than written document. Users do not and will not understand software specifications. They can only give feedback after they see can click something. So being fluent in building a HTML site is a helpful skill. Sometimes I delegate the task to a partner, as a SA role.
Rails is very good for building an ever-evolving schema. Try to use migrations and data seeding instead of writing SQL statements directly. I find myself rely on ActiveRecord more and more overtime. The script/console is a nice tool to test out those many-to-many relationships and building :conditions =>.
I worked on a few legacy database lately, the establish_connection and set_table_name feature in ActiveRecord glue old and new database elegantly.
I'd also like to use this chance to thank Ryan Bates, I learn a lot of Rails from his railscasts.

Great ruby on rails examples of almost real world applications

Great ruby on rails examples of almost real world applications:
Can somebody give some links of sites that have such codes using the best practices in structure, implementing it, models, controllers, security, views, caching, modularizing and so on? thanks
You could start with guides.rubyonrails.org. They have a lot of information on there. A very good example to start with. Start with the Getting Started link. There are also a lot of other examples on that site.
The next step you might be better off buying a book on this subject. I purchased Simply Rails 2 by Patrick Lenz. Also a very good starter book with good examples. He walks you through an app that's similar to Digg. This will get you into the Model-View-Controller mind set.
If you want to go further, I would suggest Agile Web Development with Rails, Third Edition by Sam Ruby, Dave Thomas, David Heinemeier Hansson. I would suggest the PDF because I use it as a reference and searching within the 774 pages is helpful to say the least. This is my favorite but definitely not a starter book. It's broken into two halves. The first half is a tutorial on how to write a shopping cart. With this example you get into the database models, migrations, sessions, helpers, ajax, routes, security - shows you how to create your own authentication process and more. The second half of the book is more of a reference guide and goes into greater depth than the application tutorial.
From here I would look into plugins to help you out. Search on www.github.com. They host a lot of the open source plugins available. Don't go too wild on plugins because too many will defeat the principles of being RESTful. For security/authentication I would reccomend Authlogic. I still think it's beneficial to go through the tutorial on how to create your own authentication (from the Agile Web Development with Rails book) to see what actually goes into this plugin.
Lastly, but not the least bit important is to start thinking about how you will deploy your app. You may think this is trivial but the longer you put it off, the harder it will become. Look into capistrano and deprec gems (plugins) to deploy onto a VPS. I've had numerous problems deploying to a shared host.
Don't start with the most complicated part of rails like I did. Work from the guides first and get into more complicated apps. Rails has a pretty steep learning curve.
Hope this helps.
Found your post while I was looking for the same thing, this blog post was useful:
http://blog.chrislowis.co.uk/2010/05/31/five-rails-apps-to-study-and-learn-from.html
The Real World Rails repo brings 100+ (and growing) active, open source Rails apps together in one repository using git submodules.
You can clone the collected codebases and learn from Rails apps written by experienced developers. You’ll find all the codebases in the apps/ subdirectory.
Apps you'll find there include Discourse, Diaspora, GitLab, Hound, Rails Contributors, and the Ruby Gems web site.

Resources