As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have started coding during my free time for over a year now. I had a social community idea which will be location based which basically deals with locations and nearby trending places.
I did some 10 minute video about scaffolding and have been totally smitten by Ruby on Rails. I really want to go ahead and make it on RoR.
However I don't know how to work with databases dealing with locations. I have done some research and looks like Mongo.DB is the one which is the most popular considering what 4square did. But I was wondering can we work with Active Record ? I saw a gem called geocoder , will it help me with the problem I am trying to tackle ?
Again , I have only coded in C++ , and haven't exactly worked with databases .
Which gems and tools should I be using for it ? Ruby and Mongo.db or Ruby on Rails simple using gems like geocoder ?
I felt encouraged seeing a website called www.foodspotting.com , it shows they have coded in ruby on rails ! Can someone give some good combination so that I can start thinking in the right direction ?
ruby on rails with mongo?
ruby with sinatra ?
although I am trying to stick to the RoR genre , as I have subscribed to the Michael Hartl tutorials .
I'd suggest using PostgreSQL with PostGIS. You'll need the activerecord-postgis-adapter gem to make that work with ActiveRecord.
However, a word of warning, dealing with spatial data isn't easy, and if this is your first Ruby on Rails application and your first database-backed application I would say that you're biting off a fair bit more than you can be expected to chew. Start small, start easy, work your way up.
First try to make some small applications in ruby on rails using database like MongoDB. I suggested this because you are going to use location based application implementation.
A very nice tutorial step by step that will let you go for it is -
http://www.mongodb.org/display/DOCS/Rails+3+-+Getting+Started
Regarding Geocoder - It provides object geocoding (by street or IP address), reverse geocoding (coordinates to street address), distance queries for ActiveRecord and Mongoid, result caching, and more. Designed for Rails but works with Sinatra and other Rack frameworks too.
You will find the documentation of geocoder to let you start over here -
http://rubydoc.info/gems/geocoder/1.1.5/frames
It is not a matter of choosing between MongoDB and PostgreSQL or between RoR and Sinatra.
What you really need is a RoR plugin/engine/module/whatever that can help you with map viewing, navigation, locating and geocoding. The geocoder gem is a component of this software stack.
The geocoding/mapping/navigation toolset you will choose will impose you the DB (most likely PostgreSQL with GIS extensions, that is: PostGIS) and many others implementation details.
A very well-known and largely appreciated mapping/navigation software stack is the one developed and used by OpenStreetMap (http://wiki.openstreetmap.org/wiki/Main_Page) that (you are a lucky guy...) is even based on RoR.
Have a look at their solutions and have a talk with the developers on their forum/mailing-list. I'm sure you will find what you need.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am new in ruby dont know the strength about ruby. I have some idea about ruby on rails for building web application so now i want to know about area where we can use ruby like is ruby only useful for web based application or we can write stand alone application also. like C and C++ can we write hardware level code or not. I tried to find my answer on google but did not get it and its my humble request give me guideline or some useful link to explore my knowledge and please dont close this question i am not interested in reputation i am just interested in my answer so please co-prate with me and my question .
Want a full over view and aspect of ruby its all about my future.
Ruby is a programming language and Rails is a web framework for building web applications.
If you are looking for a framework which would enable you to quickly build a web application, then Ruby on Rails is for you. Through the concept of convention over configuration, configuration is only used where necessary, and so, simple applications would no longer require lines and lines of XML.
Ruby programming language combines ideas of the dynamic scripting languages and a strong framework which is object-oriented. Additionally, Ruby on Rails leverages the extensive support of Ruby for metaprogramming, where it derives its elegance as well as its ease of development.
It makes use of code generation features, which makes it easier to start complete applications and promote agile programming techniques. Rails is also unique in the field of web application in the sense that it makes use of two key design features which are DRY or “Don’t Repeat Yourself” and CoC or “Convention over Configuration”.
Ruby is truly object oriented, in the sense that everything is object in ruby. You can built stand alone applications using Ruby.
You can Learn more of Ruby and Rails here.
Ruby is a scripting language so no it's probably not suitable for "hardware level" code. It's a higher level language than c/c++ and probably the only languages it makes sense to compare it to are perl, python and php.
Of those three I would say it's biggest strength against them is the ruby community. A consensus always forms behind good projects and competing projects either disappear or merge. It's no surprise that ruby is the number 2 language on github (let's face it, everybody has to use javascript at some point.) If you compare a common library like nokogiri to python's offerings you get a community that's split in half between beautiful soup and lxml. For php it's even more drastic. Maybe 8 competing libraries vie for the same space (and every php programmer a cowboy who thinks he can do it better).
As in above answer by Mithun, now you got the short brief idea about what ruby is ? and what Rails is ? For more better short description about Ruby on Rails(RoR) is available on wiki page here Wiki page for Ruby on Rails
You can get everything about ruby on rails on this documentation Learn all about Ruby on Rails Development.
For beginners to give startup you can start up with Ruby on Rails tutorials.
In case You are a Experienced developer in other language then you can learn a Basic Ruby language form Learn Ruby Quickly another good learning tutoral is Learn Ruby. Once you are done with basic Ruby then you can start with Rails framework. Rest of the things you can learn while developing application. Best documentation of Rails Framework is Ruby on Rails Guide. You can find everything in one place.
The best thing of this documentation is, it updates all the time when some new releases come.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Hi I am from PHP background and in am not really very familiar with these command line process and idea about operation of Rails applications. I want to get fine idea about what is this Activerecord, REST and other important task such as Rake is, more precisely what is this 'task' in Rails anyway. I have been seeing these online screen casts about Rails and I get the idea how to make it work but don't quite know how does that really work, they just extend the class activerecord and use it to their app by making custom class but what is this activerecord, I am really very confused and I am having hard time getting rails inside my brain but I really really want to learn it. Is there any suitable resource to idea idea from basic. Please help.
1) Get the "Agile Web Development with Ruby on Rails" book. Also consider getting several of the O'Reilly Rails book. Also the pragmatic programmer books on Ruby/Rails are great.
2) Join a user group if there is one in your area.
3) Base your education on your background. If you don't know OO(Object Oriented) programming, focus on ruby, if you do (java/c) background focus on the db. If you have both, focus on the view. PHP developers may find http://pragprog.com/book/ndphpr/rails-for-php-developers useful,l though it is from 2008 (Rails 2) and currently out of print so you'll need to search.
4) Make 3 or 4 applications to learn from.
5) Know that a lot of the errors you'll see are very cryptic for newbies. Don't Panic!
6) Screencasts are good, as you have found. Peepcode's (paid, e.g. $8-12 but worth it).
Ruby on Rails Tutorial: Learn Rails by Example by Michael Hartl is a good free online resource to help you get into Rails development.
Here's a few segments from the texts i've been learning from.
I am new to not only Rails, but OOP as well.
http://www.sitepoint.com/learn-ruby-on-rails-9/
http://api.rubyonrails.org/classes/ActiveRecord/Base.html
I also have "Agile Web Development with Rails" as another person mentioned. It's golden, as is anything else in "The Pragmatic Programers" series, i've found.
Rails is a framework. Ruby is the language.
It sounds as if you need to start learning the ruby language. If you stay at the Rails level you will always get that feeling of "not quite knowing how things really work". A bit like trying to learn Drupal or Wordpress without knowing enough PHP first.
I recommend the rubykoans for learning ruby:
http://rubykoans.com/
Start here:
http://railsforzombies.org/
A very nice series of screencasts on the very basics of Rails development. Comes with a great exercise platform that allows you to start practicing in your browser, without necessity of command line tools.
After you get a grasp you may check out this book.
It covers a wide variety of topics, is very accessible, and even tries to solve any potential problems you may run onto.
It's probably not a good idea to start by extending a core class :)
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have been trying to get into Ruby and the Rails framework for a while now, but somehow I find it quite hard to get started.
I have programming experience with Java, and web languages like PHP, JS. I've read around StackOverflow for a bit and while some recommend learning Ruby first, others recommend to get started with RoR straight away.
I would like to have a strong background of Ruby first before learning the framework. However, I'm not sure which are the right resources to start learning from.
Of course, there's the 'Pickaxe book', but while it's good and make things understandable, it seems to be giving code snippets more than anything else (I've only made it through the first three chapters, still going). Some of the Rails books I've read start up a project and guide you through (like the RoR tutorial book, the Agile RoR book,..). Are there any books out there for Ruby itself that have a similar approach, that is, instead of going over every part of the language, I'd like to build a project and thén go over the different parts of the language.
To get started learning ruby, I'd suggest you dive in to Why's (Poignant) Guide to Ruby.
As far as rails is concerned, I think the official rails guide is the place to start.
I would strongly recommend you Railscasts, is one of the best resources to actually get the way you should code in RoR and what to use
In terms of Ruby, one of the most useful books I have read is Design Patterns in Ruby, with really useful day to day solved problems.
I would suggest Head First Rails. Its the best book I have ever read on Rails.
Also you can read this very good book Getting real on rails by the rails founder
Go straight to http://railsforzombies.org
It's a great way to learn Rails: as efficient as crazy :)
I would suggest Ruby on Rails Tutorial by Michael Hartl. You can read it online. It's also a good introduction to test-driven development, and will get you started on git as well.
To learn Ruby itself, I'd recommend Beginning Ruby by Peter Cooper. It covers the essentials of the language and tools with small practical projects. The chapter on Rails does use Rails 2, so it will give you the concepts but you shouldn't rely on the detail there.
Beyond that, I would suggest either Design Patterns in Ruby or the newly released Eloquent Ruby, both by Russ Olsen. The Design Patterns book is excellent at explaining the standard patterns and demonstrating a Ruby way to approach them. I haven't read Eloquent Ruby yet, but it is getting very positive reviews.
It's not a ruby tutorial, but a rails demo is a good place to learn some rails stuff after you've found out a bit more about Ruby itself
for Ruby though, try hackety-hack
If your goal is developing web applications, then getting firstly the strong background in Ruby is long way, life is too short for this. Rails is also the Ruby, you're learning the Ruby while you're learning Rails. I'd recommend the Ruby on Rails 3 Essential Training, for me it was fresh and dynamic start. Then you can read another great books about Ruby.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
This is an honest question and I am not trolling.
As a newbie to rails I've been search for good rails resources. But I've been noticing many sites that apparently were once popular now being completely abandoned. Some examples:
http://www.softiesonrails.com/ - last updated Feb 2010
http://www.therailsway.com/ - last updated Aug 2009
http://nubyonrails.com/ - last updated Aug 2009
http://www.railsenvy.com/ - nothing there now
http://edgerails.info/ - last updated Feb 2010
Am I just coincidentally going to all the wrong websites/blogs (even though they're the top hits on google) or is the rails community slowly dying off? If I just happen to be going to the wrong sites can someone please point me to some currently updated sites?
Ruby on Rails was a Hype. That means a lot of people jumped on the bandwagon because that is what they do: jumping on bandwagons (for a living).
After that hype, many communities popped up, in various languages that mimic Rails. Or try to. Or just took the good ideas and applied them to their community. Now you have gazillion halfbaked PHP-frameworks, and a few actually good ones. You have Django (python), Zend, Symfony (PHP) and even in Ruby, some alternative frameworks.
That has spread the attention. There used to be only One Good Framework (sic.) now there are many.
That said, Rails 3 has just been released. Rails 3 is cutting-edge again. It has all the ingredients for noSQL (the one-but-latest Hype) HTML5 (the latest Hype) and many javascript-frameworks and interactions (the next-to-be Hype).
That said, Rails is not just Hypes. It is actually a fantastic framework. With a still very active community around it. Just look at github, and visit the trending repo's there once in a while and you will see a Great Rails Thing there every week.
If you want to keep up to date, I would advice:
http://www.rubyinside.com a blog all about Ruby.
http://5by5.tv/rubyshow a podcast with (most of) all the news in Rails and Ruby land.
I wouldn't say "dying," but it's defintely lost much of its momentum:
Google Trends on "ruby on rails":
.
For Comparison: Symfony, ASP.NET MVC, Django, CakePHP and Grails
Here are the reasons I believe caused this decline:
Overhype: The framework was very much hyped. Any kind of hype eventually fades. RoR is not a be-all and end-all web development solution; nothing is (yet).
Competition: There are now many quality frameworks for other, more popular languages. Some of them even were modeled after RoR (CakePHP, Grails, Django, etc).
Trends Comparison http://oi55.tinypic.com/k3pzy0.jpg
Ruby: Ruby is a very interesting language, but it has its idiosyncrasies. You can't program in RoR if you can't do Ruby, and proportionally few people know ruby compared to other languages.
NO! It's healthy and alive!
http://rubyflow.com - aggregated blog content
http://planetrubyonrails.com - similar
And there are many others...
In addition to the other answers, google is showing you sites with a lot of historically good content, but not necessary the most current.
For example, the Rails Envy guys have split into two good podcasts now: ruby5 at envylabs and the ruby show at envy labs (you'll have to google them, SO won't let me post the links.
The best rails guide resource is now the excellent
http://guides.rubyonrails.org/
Read rubyflow and ruby inside for a week or two, and you'll soon come across all the best ruby and rails blogs.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I've been working far too long with PHP and getting bored with it. I also want to learn a new language.
I've been using Ruby and like it. I have to decide between Rails and Sinatra, so which one would you recommend? Is it true that Sinatra can't be used to build complex apps, and it's only for simple apps?
If you are a "very newbie" with Ruby maybe you should approach Sinatra first: it's really small, well documented and easy to learn. Then, for more complex web applications, you should try Ruby On Rails.
http://railsmagazine.com/issues/5 is a free PDF introductory article I wrote for Rails Magazine.
Go with Rails, it has a lot more documentation/books than Sinatra. It is also more "mainstream" and many IDEs treat rails in a special first-class-citizen way, so it's a good idea to start with it.
While one can write any kind of application on any of the two, Sinatra is designed to be more simplist, so on Sinatra a complex case app might require extra effort.
Oh please Oh please don't start with rails. It's like going into battle for the first time against a Panzer division. Better to start with some restless natives and work your way up. Okay that's not a great analogy but rails is big time overkill for learning. You can pick up Sinatra very quickly and then migrating to rails is a reasonable step up. Same stuff just more useful things. With rails there is at ton of confusing things. They add lots of stuff onto the language, etc. If you don't know Ruby and the foundation classes then just do Sinatra. It's fast, easy and you don't have to learn about migrations, rake, etc.
you should definitely know both, because they were made for different purposes. sinatra is a micro-framework for small applications. rails is a full-blown mvc-framework with lots of helpers for almost everything.
i would say sinatra is easier to learn if you know ruby, because it's very small and follows common ruby idioms. but it's not much more difficult to learn rails as well. the documentation is great and you will find lots of tutorials and howto's on the web.
as i said, it's really good to know both so you can pick the right tool for the job.
First go with Sinatra. It is really simple and easy to understand, plus it covers the basic principles of Rails (MVC architecture, etc). Then, you can move onto Rails. Plus, with your Sinatra knowledge, you can write Sinatra apps in Rails metal, which can make it easy to create APIs.
Either Rails or Sinatra is a great learning choice.
I began working on a project in Rails where I literally knew nothing of web development or Ruby October 2009 (my cofounder helped me break though some initial hurdles and got me to RTFM). I ran into some problems but could code up business logic fairly easily. Recently I began porting a project over to the app engine and using Sinatra as a framework and it's been an incredible learning process. Mostly for learning about all the things that Rails did automatically. It also was useful for seeing a simplified definition of class members and their persistence method (migrations are unfortunately a pita though, background processes to change the format).
You may wish to consider where you will deploy.
Since I'm primarily interested in straight forward apps at a low server cost both Heroku and the Google App Engine fit well.
Rails/ActiveRecord/Sqlite and Heroku works swell
Sinatra/Datamapper/Datastore on the Google App engine flow well.
Rails is also successfully running on the app engine so this choice is open too. IMO Heroku's a little easier to deploy to.
You might want to look at Ramaze in addition to or instead of Sinatra. Ramaze seems to sit between Ruby on Rails and Sinatra as far as features and usablility.