Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Josh Page
Josh Page
1,928 Points

Help! PHP or Rails?

Hello Fellow Nerds, I have an idea for a web app in which programmers and developers can plan, publicise and get feedback on their current projects. The program would need two databases, one for users and one for projects. I have build similar projects in php before but never intended to reach the public. Would you guys recommend using php and mysql or rails? (If PHP do u have any MVC frameworks you recommend?) Security would obviously be very important as I will be storing usernames and passwords.

Thanks Josh

1 Answer

Michelle Cannito
Michelle Cannito
8,992 Points

It's a good idea to learn Rails and some Ruby. Once you do, you get more than CRUD (create, read, update, and delete) routing and functionality built in. REST combines a verb (GET, PUT, POST, or DELETE) with 4 different URLs to create 7 functions:

| index | Render a list of all posts

| new | Render a form for creating a single new post

| create | Create a single new post from the received data

| show | Render a single existing post

| edit | Render a form for editing a single existing post

| update | Update a single existing post based on the received data

| destroy | Destroy a single existing post

By using naming conventions, Rails figures out and codes a lot for you. (Metaprogramming is code creating code.)

After the initial learning curve, creating a full application in Rails is much faster than PHP because Rails creates the framework, structure, and a lot of functionality for you with just a few console commands.

And yes, there's security built-in for password encryption and storage.

Adding gems makes development even faster. For instance, there is simple_form to create prettier forms than the ones Rails generates, bootstrap to have easier CSS options (like buttons and navigation bars), and so on.

Learn Rails and fly with it. Expect to also learn how to use a console (or command prompt on PCs - you probably already know this), git and github (for change control -- saving your project initially and after each bunch of updates you make, and documenting what the overall changes were), and the basics of Ruby (very easy if you know PHP).

On teamtreehouse, go to the library and find the older Rails course: http://teamtreehouse.com/library/build-a-simple-ruby-on-rails-application/ It uses an older version of Rails, so anytime something doesn't work, just search the forum and you'll find the fix. However, it is 100 times better than the Rails course on the Ruby on Rails track because everything is clearly explained. You learn what needs to be done, why, and how step-by-step. It's a fun course.

Josh Page
Josh Page
1,928 Points

That's very helpful, Thanks!