Ruby on Rails 3 Mac OSX 10.6.6 – Some Basics

If you just switched to Rails 3, prepare for some changes…

Need an IDE?

http://netbeans.org/downloads/index.html

http://www.aptana.com/

Recommended tutorials:

http://netbeans.org/kb/docs/ruby/rapid-ruby-weblog.html

http://edgeguides.rubyonrails.org/getting_started.html

Gems mysql2 problems?:

http://stackoverflow.com/questions/3129644/rails-3-mysql-problems

New Project:

Navigate to the folder where you’d like to create a new project, terminal:

$ rails new projectname

Start Server:

Navigate to the new project, terminal:

$ rails s

Create a database for the new project, terminal (if you have phpMyAdmin simply type name and push Create):

$ mysqladmin -u root -p create projectname

Scaffold example:

$ rails generate scaffold Post name:string title:string content:text

Migrate now (env specific):

$ rake db:migrate RAILS_ENV=production

link_to example:

<%= link_to “My Blog”, posts_path %>

Console:

$ rails console

Active Record Doc:

http://edgeguides.rubyonrails.org/active_record_querying.html

Unescaped HTML (escaped now default in 3):

<%= raw post.name %>

Layout and Rendering:

http://edgeguides.rubyonrails.org/layouts_and_rendering.html

Routing from the Outside In:

http://edgeguides.rubyonrails.org/routing.html

Ruby on Rails Guide:

http://edgeguides.rubyonrails.org/index.html

Ruby on Rails Tutorial:

http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

One Response to “Ruby on Rails 3 Mac OSX 10.6.6 – Some Basics”

  1. Tweets that mention alexyz» Blog Archive » Ruby on Rails 3 Mac OSX 10.6.6 – Some Basics -- Topsy.com Says:

    […] This post was mentioned on Twitter by RubyOnRails Ireland, Ruby on Rails UK. Ruby on Rails UK said: alexyz» Blog Archive » Ruby on Rails 3 Mac OSX 10.6.6 – Some Basics http://bit.ly/eMHLAi […]

Leave a Reply

You must be logged in to post a comment.