Great ruby on rails examples of almost real world applications - ruby-on-rails

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.

Related

Rails ecommerce site with Spree what should be ideal blog solution

I have e-commerce site using spree. What should be ideal blog solution please suggest. Since the blog has to be updated almost daily it should be like CMS with end customer able to do the same. Should I use spree-blogging-spree gem or maybe blog hosted separately on wordpress ? What would be little scalable and convenient for a zero tech customer?
By your own definition ("zero tech customer") I would avoid any solution involving coding or custom code. Blog is an area where dozens of very good solution exists "of the shelf", so I would go for a WordPress or equivalent. You could even get the hosting done for you.
Integration can be as simple as putting the blog on a subdomain, for example if your ecommerce is hosted at pikachu-go.com, you could have blog.pikachu-go.com to point to the WordPress instance.
This means that the blog & ecommerce are totally independant, which should be for the best. You'll have a bit of work to ensure visual consistency between both, but a good palette and a logo may be enough to start.
If for any reason you really need the blog to be part of the same codebase (against, I advice against that), you may want to have a look to blogs that can be added to your Rails application as Engine such as https://buttercms.com/rails-blog-engine/ or https://github.com/kiddsoftware/rails_blog_engine.
Per the doc:
Engines can be considered miniature applications that provide
functionality to their host applications
So this is a way to deploy it inside your Spree app without resorting to custom code.

HOW: Static company website with Rails

I have a really stupid question in my mind.
I have used Wordpress to create a website for long time, but I dont want to use it anymore. And now I am looking for little bit different approach. Otherwise, I am quite new in Ruby on Rails. I have read some books and I am not feeling in this matter so confident. So, here is the deal:
My friend asked me to create a simple website for his company. He wants only super simple static website which will contains these pages:
Home
Products
Contact
Each page will contain simple information and there is no need to implement contact forms and other basic functionalities. I also want to deploy this app on Heroku, because he has not a lot of money and we are looking for free hosting. Moreover, I think that the best approach in this matter will be some kind of CMS which will help him to edit the website.
The overview of final solution:
Static webpages with simple CMS
Using twitter bootstrap for basic layout
Deploy on Heroku
I appreciate every contribution in this matter.
Thank you
Everything you have said suggests that you should stick with WordPress. It's perfectly capable of presenting a non-blog static website (use Pages instead of Posts) and there are some excellent themes available. WP has, over the years really become a CMS that's also good for blogging. There are other tools like Drupal that may be appropriate.
I set up a WP site with almost exactly the same goals for some very non-technical people; with a little training they eventually learned how to manage the site, upload images, add content, grant permissions to others, and do a lot of other pretty cool stuff. I have been using Rails since 2007, but for that case, it was not the right solution.
Rails is a very (very!) sophisticated web development environment used to build complex and scalable dynamic websites. With power comes a level of complexity several orders of magnitude higher than WordPress. Even if you use refinerycms you still need to do a lot of complicated setup, and need to know a lot of stuff. Even if you're using Heroku and following a RailsCast like the one for refinerycms, you'll undoubtedly hit some wall where you really need to understand more ... Rails is alluring this way -- seems simple.
If you are using this a reason to learn Rails, and are willing to invest some time, then by all means go for it. But if you want a simple solution, it's not the way. Learning Rails is like learning to fly a plane, but harder.
For static pages with rails, you can use High Voltage gem. You can find the detailed usage of this gem in this blog post . Once you create the pages, then you can easily deploy your app as like normal rails app in the heroku.

whether to use refinerycms or not

Me and a bunch of our friends decided to make a website with ruby on rails. Our question is whether refinerycms is fit with out website. What we are building is a place where our community would sign in and post up a bunch of pictures, videos, live streams, or articles/blogs. The front page would be have top feeds and featured articles. That is the idea for the most part. We thought about refinerycms but after looking into refinery it doesn't seem so fit and was wondering if its better if we just start it from scratch.
If you don't know rails and don't want to spend many hours learning.(I love it. It's fun, but not for everyone), go for wordpress.
Wordpress is easier to set up and deploy to a server.
All web hotels usually works with PHP and Mysql out of the box, witch wordpress depends on
Rails depends on ruby and that makes the server configuration more complex.
For a developer Ruby on rails is gold. But, if your main focus is to get a blog up, its to much to learn.
If you want to learn ROR go to railscast and get a pro subscription. It's the best way to pick up rails tricks
If your website mostly functions as a blog, the Refinery would be a great choice, IMHO. On the other hand, expect to do some programming on your own part if you need features such as the ones you mentioned (i.e. Live streams). On the other hand, if you're completely new to Rails, the it might be slightly more challenging, but don't let that stop you. :)

Rails Ruby Gems vs Pure Development When Generating A Rich Blog

Some ruby gems like jekyll, toto and webby offer out of the box blog-type integration into your ruby app. Another way of developing a rich web blog-type application is to build and model the application yourself using pure ruby and rails practices. (e.g creating an Article and User model). The first offers out of the box features the 2nd option offers more customization and control.
In people's experience on Stack Overflow, which would be the best route and what would people consider when making the decision to use a gem out of the box versus going alone?
All of the gems you mentioned take static, markdown/textile/etc files and turn them into HTML websites. They take different approaches to it, with jekyll spitting out the finished website for hosting, toto doing the converting and routing on request, and webby doing the same as jekyll mostly.
If you're using Rails, it's important to note that none of these will integrate into your application well. They're built to more-or-less operate on their own.
Generally speaking, if a gem has the functionality you need, use it. They are not equivalent to plugins you find for Wordpress and Drupal where they are typically low-quality, buggy, poorly documented, etc. More often than not, gems simply add a couple modules that you can integrate into your application how you like.
On the other hand, a basic blog is pretty quick and simple in Rails, especially considering you've got a handy walkthrough guide straight from the Rails documentation on how to do it.
If you're new to Rails and want tight integration with your app, it's probably best to bake your own blog features.
This will take some time to do, but its worth it to learn how things really work.
If you're more seasoned, just look at the gem's API and documentation and decide if it does what you want it to do and if you're comfortable with how to integrate it. If so, it'll save you time.
One other consideration: who will be using the blog? Is it for internal use, and programmers will be the ones updating it? If that's the case, then you can make it very easy by not worrying about a lot of aesthetic polish in the back-end. Conversely, if you're making an app that includes a blogging component for the general public you might want it to feel more polished. In this case a gem might save you a lot of time.
It depends on your application.

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.

Resources