WIFI: CoderFactory
PASSWORD: BSf111ee
Created by Coder Factory / @coderfactory / Facebook page / Github
Presented by Peter Argent / @pedrogrande
http://thecoderfactory.github.io/free-get-started-with-rails-workshop
Learning to code, changes your life.
Once you know how to build apps with code, a whole new world of possibilities open up for you and you will never look back.
"Ruby on Rails is an open-source web application framework that is optimised for developer happiness and sustainable productivity. It's lets you write beautiful code by favouring convention over configuration."
Ruby is a dynamic, reflective, object-oriented, general-purpose programming language. It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.
David Heinemeier Hansson (DHH) extracted Ruby on Rails from his work on Basecamp, a project management tool by 37signals.
It was first released as open source in July 2004.
A software framework that is designed to support the development of dynamic websites, web applications, web services and web resources.
Frameworks provide libraries for database access, templating frameworks and session management, and they often promote code reuse.
Witness the amazingness of Rails!
A development environment is the set of tools and software a developer uses when creating software.
For Ruby on Rails development:
Today we're going to use Nitrous.io to create a web application with Ruby on Rails.
Sign up for an account - it's free!
Mac: Mac
Windows: Windows
Download a text editor. I recommend Github's Atom.
In Mac: Press Cmd + Spacebar, type terminal
and hit enter.
In Windows: Start button, type cmd
and hit enter.
In your terminal/command prompt, type mkdir apps
Change into this new directory by typing cd apps
Type: rails new burgerapp
in your terminal.
Note: this is the Rails command to create a new app. The third word is the name of your application - it cannot have spaces in the name.
You will see a script being run which creates a bunch of files and gets the latest gems.
Change into the new app directory: cd burgerapp
Type: rails server
(or rails s
is a shortcut).
Open your browser and enter localhost:3000 in the address bar.
For Sublime Text on Mac
For Sublime Text on Windows
So you can leave your Rails server running while doing new commands.
Back in your terminal, open a new tab (Mac: Cmd+t, Windows: Start > cmd).
Check that your in your application folder
Mac: pwd will show your path (Present Working Directory)
If not in correct directory, you will need to use the cd command to get to it. eg. cd apps/burgerapp.
Type: rails generate controller home index
This Rails commmand generates some files and inserts some code in your app.
In your browser, go to: localhost:3000/home/index
Edit the page you see by going to Sublime and finding app/views/home/index.html.erb
When you save the HTML, refresh your browser and see the changes you have made.
In Sublime, go to config/routes.rb
Find the line that looks like this: # root 'welcome#index'
Remove the # and change the code:
root 'home#index'
In your browser, return to localhost:3000
In your terminal, type: rails g scaffold Burger name description:text price:decimal
Be careful and make sure the command is exactly correct before hitting enter.
This code creates a bunch of files that will help you enter burgers into the app.
In your terminal, type: rake db:migrate
This is a rake command that follows the instructions in /db/migrate/....rb
In your browser, go to localhost:3000/burgers
Add some burgers to your application and see how it works.
You can find and edit the code in Sublime at app/views/burgers
Ruby on Rails Guides. Check the Getting Started tutorial.
Michael Hartl's Ruby on Rails tutorial.
Learn Fast
In just 12 weeks (six class hours per week), you will become a confident web application developer, able to build anything you want.
Full stack development
Ruby on Rails gives you full stack skills - front end, backend, databases, application design and deployment.
Build your own idea
You will have the opportunity to apply your new skills by building your own app idea in the final 4 weeks of the course.
Classes are fun and practical!
With a focus on hands-on coding in every class, you will have fun while you learn. We love our amazing students at Coder Factory, they are always smart and inspiring people to know.
Tried learning online?
If you've tried learning online but keep hitting road blocks (or boredom), the Web App Developer PT course is the best way to learn coding. Meet other aspiring startup entrepreneurs who have taken action and realised that learning to code is going to change their future.
March intake is full but next intake starts in August.