PHP developer learning Ruby and Ruby on Rails [closed] - ruby-on-rails

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have been interested in learning Rails for some time now and feel now is as good as time as ever to dip in and actually get my hands dirty. I've spent the past week reading every free ebook on Ruby and Ruby on Rails I can find. I just finished reading Ruby Essentials. I have also been playing with http://tryruby.hobix.com/
I have installed Ruby, Rails, MySQL, PHP, phpMyAdmin on a Windows XP machine, I also have access to a Ubuntu machine.
I come from several years of PHP experience and around a year using CodeIgniter.
What I would really like now is a fairly basic Rails app that is a little more in depth than Hello World but not quite up to par with say a forum or blog.
I find its much easier to learn how something works when I can play with already made code and do some trial and error changes.
What I am really looking for is that 'Ohhh, I totally understand now!' moment I had when I first started learning PHP.
Does anyone have an app or know of one that could possibly provide that moment?

Check out the screen casts on Rails at BuildingWebApps . I've watched several and they have been exactly what I was looking for when learning rails. They start simple and keep adding more and more functionality. The commentators move at a good pace and subscribing to the lessons is free.

If you want something that is built already build the sample application that comes with Agile Web Development on Rails, buy the pdf from pragprog.com, the latest version is set to work with Rails 2.2, so will work with 2.3 as all the basic features of the framework will be the same.
When you are ready to move on from that, the Rails Guides website is all new and is a great resource for all developers new and old.
dwc is right though, a blog is a good thing to start on your own, so when you are confident give it a go, even if you don't put it in production it will help you along.

I would recommend railsforphp.com. They have a PHP to Ruby reference which could be quite helpful.
You can also buy the 'Rails for PHP Developers' book as either a paper or digital copy (or both if you really want to). The book is full of examples that show the PHP way and how it compares to the Ruby/Rails way.
As for ready made code, I suggest having a play with Enki. It is a somewhat bare-bones blogging system that should give you a good testing ground.

You should rethink your idea that a blog is too complex. At it's simplest a blog is a textarea and a submit button, and then storing and regurgitating the results. Start with that to get your hands dirty, then add features as you go. In fact, why not practice some Agile and do your own iterations?

The Rails Guides are nice http://guides.rubyonrails.org/

If you don't like the blog idea, you could make a wiki, this isn't very complex either. you simply need a edit button on every page with the text from the linked to it. This will teach you how to handle rails and play with ruby for things like regular expressions and such.
Take your time, break down these problems and and they should be easy for you to solve with rails.
And go on IRC (server freenode channel #rubyonrails) you can use MIRC for that. Ask questions there, I usually am there, (look for nims).

My suggestion would be to start with a simple CMS. This is something you can continue to use and expand as your skills progress and you start other more complicated projects. In the most basic form, this consists of a Page model, and a Topic model. You could then add a User model, some login capabilities and a simple admin interface. After all, Rails was originally envisioned to make it easy to CMS type sites.
As you get this up and running, you can add some plugins to extend the functionality to include tagging, comments, and more. Or you can roll these capabilities yourself.
Set up an account on Github and learn how to use Git. Its great, and better than what you used before (if anything.) You should also learn rake, and capistrano, as these are huge timesavers and work hand in hand with Rails and Github.

http://blog.caboo.se/articles/2007/4/11/sample-rails-application
http://www.railsinside.com/elsewhere/100-7-barebones-rails-apps-to-kick-start-your-development-process.html

Related

Concise introduction to Ruby on Rails for experienced developers? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
tl;dr: I want a high-level introduction to Rails, which covers what I need to get started with proper reference materials. I don't need basic concepts explained.
--
Ruby and rails both seem nice, but the documentation, although voluminous, seems to be all tutorials targeted at people who aren't that experienced as programmers or web developers, or be super-terse snippets on how to use various libraries for people who already know all about rails and ruby.
The material I'm seeing seems to be very task-oriented, which is alright if you want to follow it through without much understanding, and are able to memorise a bunch of things. I, by contrast, do not have a great memory, so I want something concise, which explains the concepts and conventions, and how they fit together. I don't need anything that "introduces" any programming concepts - I'm familiar with functional programming, late-binding, object-orientation. I'm familiar with web technologies (or at least, sufficiently so that I can learn about them). I can read code and api documentation, but I'd rather have something that lets me see the big picture first. I can look at the various resources about the language (or even better, I'd love to also look at documentation for ruby in the same vein as what I'm asking for in relation to rails).
The closest to thing I have seen to what I want is the ruby guides, but they are still very much written in a fragmented and task oriented style.
I'm not a fan of programming books (generally either too linear, becomes out of date more quickly than suites of docs maintained online), but if the best material is published in that form, so be it.
I don't think I'm that unusual in any of these respects - plenty of people know a huge bunch of stuff (a lot more than I do), don't need their hand held, but want to start exploring with a minimum of fuss.
Any suggestions?
You might be interested in Agile Development with Rails by Sam Ruby, Dave Thomas.
You could skip the "Building Application" part and go straight to Rails in Depth part.
I quote the introduction to this last part:
For the rest of the book, we’ll go through Rails topic by topic (which
pretty much means module by module). You have seen most of these modules
in action before. We will cover not only what each module does but also how
to extend or even replace the module and why you might want to do so.
The chapters in Part III cover all the major subsystems of Rails: Active Record,
Active Resource, Action Pack (including both Action Controller and Action
View), and Active Support. This is followed by an in-depth look at migrations.
Then we are going to delve into the interior of Rails and show how the com-
ponents are put together, how they start up, and how they can be replaced.
Having shown how the parts of Rails can be put together, we’ll complete this
book with a survey of a number of popular replacement parts, many of which
can be used outside of Rails.
But first, we need to set the scene. This chapter covers all the high-level stuff
you need to know to understand the rest: directory structures, configuration,
and environments.
I don't know if I have right to paste this but if that can make you buy this book, I'm sure the author would agree!
To become good at Rails in my opinion you should first be sure that you understand Ruby well. I would suggest browsing through (careful reading is not necessary if you're already an established programmer) some of the basic ruby books like: Why's Poignant Guide to Ruby
and Programming Ruby.
After this, you should become familiar with the Rails API's and DSL's, I would suggest beginning with reading Ruby on Rails Guides. When you understand the Rails basics the ultimate Rails reference is Ryan Bates' excellent Railscasts. If you don't like watching videos the site has an ascii mirror. Even if you don't have a specific task in mind, go watch a few of these to really understand the way problems are tackled in Rails.
Ofcourse when it comes to actually gaining skill in developing Rails skills, it is imperative that you try your hand at actually making a few Rails applications. Rails has a notoriously steep learning curve, so it's best when you have tried a few simple unimportant applications before you try to build your life's work with Rails.

Should I learn Rails, Joomla or DHTML as a beginner? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
This is not a core programming problem as most posts on this website are, forgive me for that but I didn't know where else to ask this.
I am a beginner in web languages and want to build a small website for our family business, mostly a bunch of galleries that would display our different product lines with prices and some basic specs for customers to get an idea..currently I'm pursuing comp science at the undergrad level
So here is the problem, I can't decide between platforms
I started out with HTML and making a basic mock up but that didn't quite work out as i needed to have dynamic galleries that was quite hard to code by hand and since we need to update often it would be a pain even if I did manage to get it going
then I thought of Joomla as it would be easy to update but soon realized that its not that easy to customize templates
Then I started reading about Ruby on Rails and what it offers and it sounded really interesting might be useful in developing applications that we possibly would need in some time.
so I wanted to know from the community which course should one pursue: DHTML, Joomla, RoR
Please keep in mind that I want this to be a learning experience that will be useful possibly in the future in my professional career and at the same time get the job done.
I would also greatly appreciate any resources or suggestions that the community might have.
You are actually comparing apples to oranges here as DHTML, RoR, and Joomla are not the same thing. You are comparing a mark up language, to a programing framework, to a content management system. You could feasibly learn a CMS (Joomla, Drupal, Wordpress, etc) and never learn to code a single line of HTML or PHP.
For the purpose of getting a site that you can manage and edit yourself, then what you are asking is which CMS should you use. There are dozens of CMSes and opinions on which one is the best. In general are the big 3 - Wordpress, Joomla, and Drupal. Wordpress is by far the easiest to learn. It has a very simple admin that shouldn't take more than a few minutes to figure out. There are tons of themes and extensions that go along with it. The downside is that it's coded to be a blogging platform, not an extensible CMS. That means that doing things other than blogging are harder to accomplish (relative to Joomla and Drupal). It can still be done, but the more complex the site, the harder it is to do in Wordpress.
Joomla is the next step in ease of use. The admin is significantly more complex than WordPress, but a tech savvy user will get the basics down in the first couple of hours or so. Extendding Joomla is much easier for both the developer since the framework is specifically designed to be extended, and the user since installing is very quick and easy for most extensions. It's a pretty good balance between ease of use for the admin and ease of extension for the developer.
Drupal is probably the most powerful of the 3, but the trade off is in the user admin. Most non-developers will struggle to understand how the admin works or what taxonomy is and how it works. Again, the trade off is that it allows developers much more power in extending Drupal. Drupal makes it easier for the developer to accomplish much more complex tasks than Joomla or Wordpress.
At the end of the day, all 3 can accomplish the exact same thing on a website. You need to determine which one will accomplish your particular needs the best.
That said, you should still learn HTML and a programming language. My recommendation would be to learn PHP and mySQL. That will give you a solid foundation on which to build on once you are well versed. Other languages and flavors of SQL will come easier, plus many of the large open source projects are done in PHP/mySQL.
Since what you are trying to do is a pure learning exercise, I suggest you look around into a lot of things(rails/css/javascript/php etc) until you finally find the one that you will have fun playing-with. You learn faster when you can tinker with it.
Ruby on Rails may 'seem' easy to an advanced web developer. Its an advanced framework and needs considerable amount of investment in terms of time and interest and most importantly you need to have an aptitude for it. If you REALLY want to do this, and you have a general aptitude for Web programming, I suggest you start with Wordpress. Its search-engine friendly and will get you running in no time.
Learning we development and design is not a small task. It'll take you years to get even moderately good, so if you need to get something up and running now, I'd not recommend you to build it yourself.
There are a lot of nice Joomla templates and plugins available if you are ready to pay a small price for it. Search around a bit more, and you might find something that works for you.
I would start with a CMS such as Joomla or perhaps even Wordpress. Grab a template and tweak it - this will be a good introduction to coding websites as the really hard parts are already taken care of.
Once you have finished the site that you are working on then you can think about moving on to a framework such as Rails or even a PHP based once like Code Igniter. The frameworks will take a lot longer to figure out but at the end of the day they will give you a better learning experience then just tweaking a CMS template.
I would say it depends on your goal. As mentioned they have different purposes. That said I would say Joomla or Rails.
If you are interested in CMS (or design), and don't want/care about getting down and dirty into coding then I would use Joomla and learn what you need to acccomplish your goal.
If your goal is to be able to develop custom web APPLICATIONS, I would probably learn Rails. There is much more of a learning curve but you will get experience with things like html5, javascript (or coffeescript), css3 (or sass), exposure to the MVC model (model view controller) and exposure to Ruby.
But with Rails there is a lot more to learn, but you will have a lot of knowledge.
If you want to go down the rails path, maybe start with a Rails CMS (like locomotive or refinery) b/c they are written in Rails, you could look at the code or have some insight into the CMS. Disclaimer I have not used a Rails CMS (just did some research)
I would choose Joomla. They have a vast array of components and modules that should meet your needs. As far as customization, if you are a beginner this will be difficult no matter the platform. DHTML is not a platform. DHTML is mainly javascript, css and php. I suggest you get some books on doing dynamic stuff with javascript and jquery, styling with css and creating MVC sites with PHP. When you learn all this first your job customizing an whatever platform will be much much easier.

Web Framework - Ruby on Rails or Django for beginner? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am still new to web framework and I am thinking of choosing either Ruby on Rails or Django. Which one should I go for as a beginner?
If you don't know either, you're maybe a little better off with Ruby on Rails...
If you are experienced with programming at all, try this: I have found that almost all of my developer colleagues decide on RoR or Django based on the language. Both are a quick pick-up, and more often than not, one of the two languages will just "speak" to you.
I'm somewhat OCD with my code (and life) and for me, Python was a better fit. I felt calm while writing it, and more importantly, calm while reading it. However, the guy that sits next to me - and I have a mountain of respect for - found Ruby to be more appealing.
So my suggestion? If you already know how to write code and the meaning of Object Oriented, spend a day with each language. Almost invariably, you'll respect one, and fall in love with the other.
THEN pick a framework :)
I have no experience in using RoR but 3 years of knowledge about Django. A very huge advantage of Django is its very good Documentation.
Especially for a beginner this might be the most important fact. Even most of the third party apps (pluggable modules/plugins) for django are document very good and are easy to use.
On the other hand Django code is in IMO more readable since its Python code - Ruby code tends to get messed up a bit faster.
I'll assuming you don't know Ruby or Python already, since that would be the number one determinate of which way to go. Having developed both Rails and Django projects, my take is that you probably can't go wrong with either, but my feeling is that Django is better oriented towards building sites for publishing, whereas Ruby is more oriented towards webapps. This is not to say that you can't build a great web app in Django build an awesome CMS in Rails, of course. But take a look at most of the high profile users of Django: NYTimes, The Guardian, Washington Post, LA Times, The Onion, AV Club, Everyblock. Those folks are more oriented towards publishing. Meanwhile, things like GitHub, BaseCamp and Twitter (partially) run Rails. So ask yourself what type of sites you are likely to be building and go from there. But really, like other posters have recommended, there's no reason no to spend a few days playing around with both and seeing what feels like a better fit.
Both are good. From experience, though, you'll get better and more up-to-date documentation most of the time for both Python and Django.
Both are GREAT!! by I prefer Rails because of:
MVC! Model View Controller.
The wide community of Rails.
Many big projects like Twitter, 37signals products are built on Ruby on Rails.
The BIG and the HUGE libraries and gems for Rails/Ruby.
and many other reasons. Well, you have to see this: Rails Django-Comparison and rails-vs-django
Amr
This is a little subjective since it can depend in no small part on your general programming background. Do you know Python? Do you know Ruby? In general, you're best off choosing the framework for a language you already know since then you're only learning one new thing instead of two.
If you don't know either, you're maybe a little better off with Ruby on Rails due to its greater mind-share in the general development community currently. This will make it easier to find help and example code online.

Django or Ruby-On-Rails? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have been looking at jobs. Most of the companies require RoR or Django experience. I don't know any of the languages. The number of organizations working with RoR is greater than Django. But I prefer django because of python.
What do you coders/recruiter suggest me to know?
My best answer is for you to learn both.
Consider this your end goal, and instead consider your question as, "Which one should I learn first?"
I recommend that you start with Django, especially if you have Python experience. Django's approach, like that of Python itself, is more condusive to learning. Once you've gotten your feet wet, learn Ruby on Rails, because that's the framework that will net you easier cash when you get out into the modern Web 2.0 workforce.
Once you're thoroughly familiar with Ruby on Rails and have been working for a bit, continue learning Django. Refamiliarize yourself with the basics, then start to learn some of the more advanced stuff. Django's inner guts are supposedly easier to dissect than that of Rails. If you ever find yourself faced with a job opening with a surprisingly novel and challenging web platform to implement, you'll find your Django knowledge quite handy.
Here's a bulletized rundown:
Django
Great documentation
Thorough tutorial to ease you in
Fewer files to understand at first (vs. scaffolding in Rails)
Built on Python, which you might as well know anyway
More similar to enterprise stuff like Java Servlets/JSP
Easier to dig into its innards
Ruby on Rails
It's what's hot
Hot means more jobs
You want money, don't you?
When you want to make a "traditional" web 2.0 site, its generated code lets you get done really fast
Integration with JavaScript libraries
Built on Ruby, which you might as well know anyway
Verdict: Django first (do the tutorial), then Rails, then Django again
I'd suggest you to do some research regarding technologies trends and professionals demand, you can do this by using Google tools, such as Google Trends
See more details about technology research here. Happy coding!
If you're more familiar with Python, then you should do Django. Google App Engine is a big user of Django, and you can use that to "sharpen your saw" in Django skills, for a cost-free investment.
Learn both.
Look for a company, where the people (without ties) have fun working there and speak compassionate about there work. This matters far more, than the technology they're working with.
If you are low on time, and have to choose one, just choose the one, for which you know how to program. If you know python, learn django, if you know ruby, learn rails. Both have excellent tutorials, and reference materials, RoR rules in screencasts, django rules documentation and tutorials.
If you have a lot of time on hand, say 3-4 months, then learn both. What's wrong with that?
try ruby...I love ruby over python then I prefer rails over django...but if you try ruby and don't like it your best option would be django...
I think it depends on how much convention you are used to. Coming from MVC4 to Django I like alot of things, but find I am writing more code where django calls for configuration vs convention. I have found that there are alot of generic methods that I am finding that reduce this, so it might be a learning curve issue for me.

What is the best way to properly get to know the Rails framework? [closed]

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 doing two projects on Rails which have worked out quite nicely but have in the process reinvented the wheel, running (and hot) water and painkillers which are as I have learned subsequently already present in the framework.
So basically, what is the best way to properly get know all the clever parts in the framework that will save time instead of building functionality yourself that has already been implemented? Reading the docs from page 1 onwards? Is there a particular sample app that exposes everything? A particular open source project? All the railcasts? Or something completely different?
A number of people have suggested a series of books, but I might not have made myself clear enough in what I was looking for. I already have a number of Rails (and one Ruby) books that to different degrees explain the Rails framework but that's not really what I'm looking for. Example:
I coded my own function to pretty print numbers as currencies (actually I extended Object to do that for me) because I had no idea that number_to_currency existed. Now that's not a big deal in terms of time but I am sure that I have done my own methods many times simply because I didn't know a similar rails function existed.
So again, how do I find out that number_to_currency (and the myriad of other functions) exist?
This is a bit subjective. But if you haven't read Agile Web Development With Rails, I'd definitely recommend that, with the prior understanding that quite a bit of new stuff has been added since then, and the 3rd edition will be coming out very soon to reflect this. Also, Ruby for Rails is great if you weren't already familiar with Ruby.
Other than that, definitely pick a Rails blog and follow it (maybe Railscasts); go back and read the archives.
Last but not least, before you start inventing something, thoroughly google it and/or post on the Rails forum to make sure it isn't already around.
I second the recommendation for Agile Web Development With Rails, I have the 3rd edition in beta/PDF and it really helped. You find also many guides on this site. Don't forget things like Bort and its fork like this one.
Time.
Really.
The previous answers pretty much cover the best there is in terms of resources to learn Rails. But my personal favourite is Ryan Bates' excellent series of Railscasts. Also, Peepcode has some excellent Rails screencasts
He covers pretty much every little thing one is going to need in any Rails project.
As far as books go, Simply Rails 2 was very helpful
look at Bort, Caboose sample app, some others, then write your own
http://jimneath.org/2008/09/09/bort-base-rails-application/
http://www.railsinside.com/elsewhere/100-7-barebones-rails-apps-to-kick-start-your-development-process.html
I would also look at post-tutorial books like Ediger: advanced Rails, Rappin: Professional Rails, "Art of Rails" (Wrox, can't remember author) Chak/oreilly : Enterprise Rails. Read reviews on Amazon, pick 1 or 2.
The first good way to get to know Rails is by actually making something in it -- anything really, even just a simple blog or something like that. Doing so will show you what you'll need to know and look up to build a good rails app.
I also have two books I've used to learn Rails: Agile Web Development with Rails by David Thomas and David Heinemeier Hansson, and Beginning Rails: From Novice to Professional by Jeffrey Allan Hardy and Cloves Carneiro Jr.
"Use the source, Luke." I was just reading an article on the desirability of reading the Rails source as a way to really understand what's going on. Of course I closed that tab before I saw this question....
I am not sure why the other poster is getting voted down. There is no substitute for actually writing code. Lots of it.
Having a sample project in mind is one of the best ways to start in my opinion. Pick something fun (not a huge idea that you've been dreaming of, but something small and intersting to you) and start working on it!
Some of the sample videos on the Ruby On Rails site along with the Agile Web Dev book really help getting the basics down. When you're trying to solve specific problems, things like Railscasts or Peepcode really really help.
Its sometimes difficult to get things "right" the first time when there are so many ways of doing something with rails. "The Rails Way" book is a good way to find out some of these, but Railscasts cover things the Rails way as well.
Rails is not trivial, a lot of the magic is hidden.
I'd recommend choosing a project that you're going to do. Do not pick "create a blog" or whatever, choose a real project that you want to see happen. Then read a book like Agile Web Dev with Rails and try to code following the examples and tutorials.
Do not hesitate to spend time to entirely refactor your code to improve what you did. You WILL find out that you did everything wrong and have to redo 50% of your code. It's impossible to get it totally right the first time.
My favorite way is to watch the Railscasts:
http://www.railscasts.com

Resources