CSC/ECE 517 Fall 2012/ch2b 1w61 ns

From Expertiza_Wiki
Revision as of 01:59, 19 November 2012 by Nvenkat (talk | contribs) (Created page with "Connecting Architectural Concepts to Rails Apps The structure of a typical Rake file is as follows: app /models/, views/, controllers/ /helpers /assets/s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Connecting Architectural Concepts to Rails Apps

The structure of a typical Rake file is as follows:

app /models/, views/, controllers/

        /helpers
        /assets/stylesheets/application.css

config /routes.rb

       /database.yml

db /development.sqlite3,test.sqlite3

       /migrate/

log /development.log, test.log

There is no special format for a Rakefile. A Rakefile contains executable Ruby code. Anything legal in a ruby script is allowed in a Rakefile. There is no special syntax in a Rakefile, there are some conventions that are used in a Rakefile that are a little unusual in a typical Ruby program. Since a Rakefile is tailored to specifying tasks and actions, the idioms used in a Rakefile are designed to support that. Tasks are the main unit of work in a Rakefile. Tasks have a name (usually given as a symbol or a string), a list of prerequisites (more symbols or strings) and a list of actions (given as a block). Rails is a web application development framework written in the Ruby language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks.