Railstutorial : which parts of the app to upgrade first? - ruby-on-rails

After finishing with Rails Tutorial by Michael Hartl, which parts of the sample app proposed in tutorial should I upgrade first? Authentication method comes to mind first..
Given the huge popularity of that tutorial, I suppose there is something like a list of steps to be taken for that app to become more up-to-date in this ever changing world of web dev etc. etc. etc.
Overall is it a good idea to use that app as a foundation for building something more advanced?
Thanks in advance!

I learned Rails with that book :)
However, even the authentication algorithm used there is great to learn, in practice you can use other alternatives. For example I use the wonderful Devise gem (Railscasts 209 and 210).
There are some ideas at the end of the book that explain how you can extend the application. However, I think that building your own app from scratch is better now that you know how to do it.
After reading that book, I created some basic projects, and in parallel started reading The Ruby Programming Language and The Rails 3 Way.
Hope it helps! Welcome to the Rails world :)

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!

How do I develop a web page that returns password for users to register?

I am doing a project on creating a lab application for a next generation sequencing data using ruby on rails.
The main idea my boss suggests me to do is to have users fill in their details and submit to us. After the submission, the administrator, i.e. me, would send them a password which they can use to login my application. could some one help me with the idea of development. I am naive to ruby on rails and would be very grateful for people who help me.
thank you and cheers
I would start with Michael Hartl's RailsTutorial. Not only did I find it the best way to get started - the application he builds includes a bombproof user security model, just as you require, and so you'd be both learning and developing something relevant at the same time.
I'd also recommend buying the videos, as well as the book. They make all the difference.
Are you new to the whole web development thing or is it just Ruby on rails that you have no knowledge of?
If the former, I'd suggest googling some Ruby tutorials on how to make a simple web application and build from there. Start by a simple "Hello world" application, then proceed to handle submitted forms, then install and use a database and by then you should have the basic knowledge to build what you want.
If the latter, could you specify, what parts you need help with? Ruby is syntactically quite easy to learn if you just take a look at some tutorials, so that shouldn't pose any problems. You have described a simple use case which I'm sure you can handle in a new environment, if you just have the patience to try and learn.

How to create Rails App using cucumber

I am new for cucumber. I want to create on sample application using cucumber.
I am working on Windows 7 OS. Can any one guide me?
Thanks.
I think these are two separate problems:
Building a Rails application on Windows
Building a Rails application with Cucumber (using principles promoted by Cucumber like BDD, Specification by Example and an outside-in workflow)
Building a Rails application on Windows
There are a lot of tutorials, best starting point is probably: Getting Started with Rails on Rails Guides.
However the official advice there is using a virtual machine with Linux :-)
Here is a good thread with advice for running Rails under Windows.
Building a Rails application with Cucumber
An extraordinary example for this is the Book Rails 3 in Action by Manning.
This book really excels at showing how to create an application outside-in with Specification by Example using Cucumber.
In each chapter of the book a new feature is implemented. There are almost no screenshots explaining those features. Instead the authors are using Cucumber scenarios at the beginning of each chapter to exactly specify the desired new behavior that is the topic of given chapter. Then they are showing and explaining the necessary steps and the code that is needed to implement the functionality.
This is the best example I have found for using Cucumber with Rails so far.
This is also a really great example how Specfication by Example can be used for building a shared understanding - since teaching is all about sharing understanding.
However the scenarios in the book are quite focusing of specifying behavior on the UI level ... which is not commonly agreed on being best practice. But for teaching Rails it is great.
Rails 3 in Action is still in the early access program. I don't know where the official sources are.
But when you search on GitHub you already find different implementations of the example application (Tiketee):
https://github.com/rubykr/ticketee
https://github.com/oMartell/ticketee-rails-3-in-action
https://github.com/rails3book/ticketee
Here is the guide how to do it.
I found an interesting webcast video that does just this.
The basic procedure is define a couple features in cucumber. (actually the gherkin language)
Run cucumber
Fix errors
Repeat the
2 steps until you have a
working app.
It makes use of a few RoR gems like webrat and rspec.
http://railscasts.com/episodes/155-beginning-with-cucumber

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

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