This document provides an introduction to a Ruby on Rails training being conducted by James and Dana Gray. It discusses the structure of the training, including introducing the teachers and having students introduce themselves. It also provides an overview of what will be taught in the training, including building web applications using Rails, with roughly half the time spent on hands-on labs where students will build a working Rails application.
The presentation gives an overview about the ruby programming language and Rails, the web framework built over it ruby. It does highlight some of the key features of ruby programming language and mentions the key benefits of using Rails framework for web application development.
The presentation gives an overview about the ruby programming language and Rails, the web framework built over it ruby. It does highlight some of the key features of ruby programming language and mentions the key benefits of using Rails framework for web application development.
RoR是Ruby on Rails的缩写,是一个用于编写Web应用的框架。他基于Ruby语言,给开发人员提供了强大便利的框架支持。Ruby有很多优点,但是一直以来其流行范围仅局限于日本。2004年,当Rails框架横空出世,让人们认识到了一个更符合实际需要并且高效的web框架,在其出现不久就受到了业内的广泛关注。吕国宁将结合自己三年的Rails开发经验,给大家介绍一些Rails的优点,背后的设计文化,以及Rails的前景发展等内容。
Presentation on React.rb, which is Opal + ReactJS. I did several interactive demos, but have linked to some resources.
References:
reactrb.org
inline-reactive-ruby
figwheel
Code for this:
http://tinyurl.com/20160512-DCRUG-React-rb
WIP White Elephant App:
https://github.com/awwaiid/reactrb-elephant
One of the main reasons Titanium Mobile has been so successful is that the technology has significantly lowered the barrier to entry for native mobile development. A major force behind this is JavaScript, Titanium's primary programming language. The JavaScript programming language is small enough where the basics can be learned in a matter of hours, which has enabled developers from many different backgrounds to become productive using Titanium. But there's much more to JavaScript than just control structures and a handful of primitive data types - JavaScript is a beautiful functional programming language with great features you might not be using.
Most developers working on the web today have had some exposure to JavaScript, but there's a difference between using jQuery for DOM manipulation on a web page and writing an entire application in JavaScript. This talk, intended for beginner or intermediate JavaScript developers, will focus on the essential language features you will need to write professional JavaScript applications, including but not limited to:
Object Oriented Programming in JavaScript
The Good Parts and Bad Parts of JavaScript
Useful JavaScript Patterns, Tricks, and Style Guidelines
The JavaScript runtime in Titanium Mobile
Further Reading and ways to stay up to date on JavaScript
Core Data doesn't have to be hard. Step by step, learn how to use Core Data in code, creating models and relationships. Loading data and efficiently displaying that data.
Based on the example of the XWiki Open Source project (http://xwiki.org) this session will describe a number of practices to improve the quality of a Java project. Also, it will show how to implement these practices so that they are automatically checked and enforced. Some examples include: *How to make sure your project does not break binary compatibility unintentionally and, more generally, how to successfully evolve an API without breaking your users; *How to manage the JAR hell and avoid duplication of classes in your application at runtime; *How to automatically control the test coverage and the associated policies; *How to automate functional testing of web applications and how to avoid false-positives that plague any project..
RoR是Ruby on Rails的缩写,是一个用于编写Web应用的框架。他基于Ruby语言,给开发人员提供了强大便利的框架支持。Ruby有很多优点,但是一直以来其流行范围仅局限于日本。2004年,当Rails框架横空出世,让人们认识到了一个更符合实际需要并且高效的web框架,在其出现不久就受到了业内的广泛关注。吕国宁将结合自己三年的Rails开发经验,给大家介绍一些Rails的优点,背后的设计文化,以及Rails的前景发展等内容。
Presentation on React.rb, which is Opal + ReactJS. I did several interactive demos, but have linked to some resources.
References:
reactrb.org
inline-reactive-ruby
figwheel
Code for this:
http://tinyurl.com/20160512-DCRUG-React-rb
WIP White Elephant App:
https://github.com/awwaiid/reactrb-elephant
One of the main reasons Titanium Mobile has been so successful is that the technology has significantly lowered the barrier to entry for native mobile development. A major force behind this is JavaScript, Titanium's primary programming language. The JavaScript programming language is small enough where the basics can be learned in a matter of hours, which has enabled developers from many different backgrounds to become productive using Titanium. But there's much more to JavaScript than just control structures and a handful of primitive data types - JavaScript is a beautiful functional programming language with great features you might not be using.
Most developers working on the web today have had some exposure to JavaScript, but there's a difference between using jQuery for DOM manipulation on a web page and writing an entire application in JavaScript. This talk, intended for beginner or intermediate JavaScript developers, will focus on the essential language features you will need to write professional JavaScript applications, including but not limited to:
Object Oriented Programming in JavaScript
The Good Parts and Bad Parts of JavaScript
Useful JavaScript Patterns, Tricks, and Style Guidelines
The JavaScript runtime in Titanium Mobile
Further Reading and ways to stay up to date on JavaScript
Core Data doesn't have to be hard. Step by step, learn how to use Core Data in code, creating models and relationships. Loading data and efficiently displaying that data.
Based on the example of the XWiki Open Source project (http://xwiki.org) this session will describe a number of practices to improve the quality of a Java project. Also, it will show how to implement these practices so that they are automatically checked and enforced. Some examples include: *How to make sure your project does not break binary compatibility unintentionally and, more generally, how to successfully evolve an API without breaking your users; *How to manage the JAR hell and avoid duplication of classes in your application at runtime; *How to automatically control the test coverage and the associated policies; *How to automate functional testing of web applications and how to avoid false-positives that plague any project..
The SlideShare 101 is a quick start guide if you want to walk through the main features that the platform offers. This will keep getting updated as new features are launched.
The SlideShare 101 replaces the earlier "SlideShare Quick Tour".
APIs are ubiquitous, but they can also be fun! In this talk, we'll take a look at using the Spotify API and Developer Portal to put together a simple app - finding Frank Sinatra's top 5 song. We'll learn about using APIs, how to connect when Authentication is necessary, and what to do with an API payload.
身為工程師,一定聽過編輯器之神 - Vim, 而很多人雖然使用過 Vim,卻因為學習門檻而沒有繼續深入,無法體會到它 的威力,實在有點可惜,因此講者這次嘗試用較易於理解的方式來說明 Vim 最核心的功能——編輯,當理解了 Vim 編輯的設計方式之後,使用者將可以輕易的做出數以千計的操作組合,來進行精確且直覺的游標移動與文字編輯,同時也會介紹 Vim 在開發 Ruby & Rails 上適合的配置。
內容不會涉及太多 Vim 獨有的功能,希望除了 Vim 使用者外,其他編輯器的使用者也能夠透過 Vim mode 來體驗 Vim 的強大之處。
Is ruby on rails dead or still good choice for building appsTemok IT Services
Is ruby on rails dead? No, ruby on rails is not dead. It is still alive and a good choice for building web applications. Let’s have a detailed discussion on why people say ruby on rails dead?
Read more: https://www.temok.com/blog/is-ruby-on-rails-dead/
#rubyonrails #programming #python #webdevelopment #webdeveloper #Appdevelopment
Learn about the art of writing code that writes code. In this session we will explore some of the metaprogramming techniques that make Ruby the ideal language for framework development.
Metaprogramming techniques can greatly reduce the amount of code you write while clarifying the intend of your code. Learn how frameworks like Ruby on Rails and others exploit metaprogramming to infuse that special magic that only open dynamic languages can produce.
Welcome To
Ruby Rails Web Development
Ruby on Rails Development Benefits and Pitfalls
Understanding how the many components of digital design and development are connected is crucial for web developers. Each pillar supports the span, much like a bridge, and if any one of them fails, the entire structure falls. Both poor design and poorly written code can obliterate even the most complex design solutions. Every component contributes to the final result, a user-friendly product.
We have provided you with some background information on the terms, procedures, and tools used in web development in previous posts. This article will carry on that theme. We're going to discuss one of the widely used web development tools, Ruby on Rails, and share some of its advantages and disadvantages with you.
brief history
A brief history will be presented first. Ruby is an open source, dynamic, object-oriented programming language with an emphasis on efficiency and productivity. The original version of the language, Ruby, which was created by Yukihiro "Matz" Matsumoto, was initially made available in the 1990s. Today, it provides power to popular services like Basecamp, Hulu, the original Twitter, and Living Social. Because Ruby offers a framework that supports a high level of developer flexibility, many businesses, including BBW, Cisco, CNET, IBM, JP Morgan, NASA, and Yahoo, employ it in some capacity.
The open-source Ruby on Rails web application framework is designed to increase programmers' long-term productivity. From his work on the project management tool Basecamp at the web application firm also known as Basecamp, David Heinemeier Hansson extracted Ruby on Rails. In July 2004, Hansson first made Rails available as open source. Even well-known companies like Amazon and eBay have Rails projects.
From my work on Basecamp, a project collaboration tool from 37signals, Rails (Ruby on Rails) was extracted. It was therefore driven by needs rather than predictions. And I think a large reason why we're doing so well right now is because of it. I didn't make an effort to consider what certain programmers could require for a dream job. I merely constructed what I required to complete my work cheerfully. David Heinemeier Hansson, the author of Ruby on Rails, is a different interviewee.
What is Ruby on Rails?
Model-view-controller (MVC) is how Rails apps work. This technique is utilized by numerous other web frameworks, including AngularJS (JavaScript), Django (Python), and CakePHP (PHP).Models, Views, and Controllers are the three components that make up the apps, according to this. These parts perform the following functions:
They include the functionality needed to modify and get the many types of data the app uses. A model is represented as a class in Rails. They are not low-level data types like strings or arrays.
Create the logic that connects views and models (and the data they are linked with). They perform input processing, make method calls, and send data to
At the Melbourne Ruby users group we held a session to introduce people to Ruby and Rails. This is my presentation which gave the rough overview of Rails.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
5. Who am I?
My name: James Edward Gray II
My experience: I’ve been using Ruby since before
Rails was released and in the last five years I’ve worked
on over 30 shipping Rails applications
6. Who am I?
My name: James Edward Gray II
My experience: I’ve been using Ruby since before
Rails was released and in the last five years I’ve worked
on over 30 shipping Rails applications
The One True Dessert Food: Angel food cake
9. Who is my partner?
Her name: Dana Gray
What James thinks about her: She’s cute!
10. Who is my partner?
Her name: Dana Gray
What James thinks about her: She’s cute!
Her secret: She’s having a baby
11. Who is my partner?
Her name: Dana Gray
What James thinks about her: She’s cute!
Her secret: She’s having a baby
Ignore what she says about dessert because we
already learned it is: Angel food cake
15. Your turn!
Please tell us:
Your name
What you know of Ruby/Rails and what you hope to
learn in this training
16. Your turn!
Please tell us:
Your name
What you know of Ruby/Rails and what you hope to
learn in this training
A fun fact (doesn’t have to be your favorite dessert)
19. We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
20. We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
It’s a lot to cover and we don’t have time to do it all
21. We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
It’s a lot to cover and we don’t have time to do it all
We will hit the basics
22. We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
It’s a lot to cover and we don’t have time to do it all
We will hit the basics
We will dig deeper in some areas
23. We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
It’s a lot to cover and we don’t have time to do it all
We will hit the basics
We will dig deeper in some areas
We’re assuming you have minimal HTML, CSS,
JavaScript, and programming knowledge
25. We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
26. We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
This training is roughly half lab exercises
27. We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
This training is roughly half lab exercises
You will build a working Rails application over the
next three days
28. We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
This training is roughly half lab exercises
You will build a working Rails application over the
next three days
Make some new friends and work together!
29. We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
This training is roughly half lab exercises
You will build a working Rails application over the
next three days
Make some new friends and work together!
I promise you will both learn more that way!
33. We are Interactive
Wake up!
We like questions
Everyone benefits if we turn this into more of a
discussion and less of a lecture
34. We are Interactive
Wake up!
We like questions
Everyone benefits if we turn this into more of a
discussion and less of a lecture
Help us
35. We are Interactive
Wake up!
We like questions
Everyone benefits if we turn this into more of a
discussion and less of a lecture
Help us
Please stop us with questions as you have them
38. Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
39. Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Web development has exploded
40. Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Web development has exploded
Think about how many boxed software applications
you buy now verses how many Web sites you use
41. Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Web development has exploded
Think about how many boxed software applications
you buy now verses how many Web sites you use
Social networking is huge (Twitter, Facebook, …)
42. Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Web development has exploded
Think about how many boxed software applications
you buy now verses how many Web sites you use
Social networking is huge (Twitter, Facebook, …)
Many mobile applications use Rails as a backend
45. Rails is Ruby, right?
Wrong!
Ruby is a programming
language
The Ruby
Programming
Language
46. Rails is Ruby, right?
Wrong!
Ruby is a programming The Ruby on Rails
language Application
Ruby on Rails, or Rails
Framework
for short, is a The Ruby
framework written in Programming
Ruby Language
47. Rails is Ruby, right?
Wrong!
Ruby is a programming The Ruby on Rails
language Application
Ruby on Rails, or Rails
Framework
for short, is a The Ruby
framework written in Programming
Ruby Language
You will use both
51. The Ruby
Programming Language
Created in Japan in 1995 by Yukihiro Matsumoto (“we
call him “matz”)
It’s a few months older than Java, not new
Is high level with many modern features: Objects,
Exception handling, Garbage collection, …
52. The Ruby
Programming Language
Created in Japan in 1995 by Yukihiro Matsumoto (“we
call him “matz”)
It’s a few months older than Java, not new
Is high level with many modern features: Objects,
Exception handling, Garbage collection, …
It’s very dynamic and expressive, literally allowing you
to mold it to your specific needs
54. The Ruby on Rails
Application Framework
Created in 2003 by David Heinemeier Hansson (we call
him “DHH”)
55. The Ruby on Rails
Application Framework
Created in 2003 by David Heinemeier Hansson (we call
him “DHH”)
Rails was extracted from the real world application
Basecamp
56. The Ruby on Rails
Application Framework
Created in 2003 by David Heinemeier Hansson (we call
him “DHH”)
Rails was extracted from the real world application
Basecamp
It adds Web needs to Ruby: requests and responses,
routing, database modeling, …
57. The Ruby on Rails
Application Framework
Created in 2003 by David Heinemeier Hansson (we call
him “DHH”)
Rails was extracted from the real world application
Basecamp
It adds Web needs to Ruby: requests and responses,
routing, database modeling, …
It also modifies Ruby’s core in quite a few places to
better suit the problem domain of Web applications
60. The Rails Way
Rails often has a preferred approach to a task and it
assumes you will be taking that approach
61. The Rails Way
Rails often has a preferred approach to a task and it
assumes you will be taking that approach
You can almost always choose to do things the non-
Rails way
62. The Rails Way
Rails often has a preferred approach to a task and it
assumes you will be taking that approach
You can almost always choose to do things the non-
Rails way
However, this will not be as easy
63. The Rails Way
Rails often has a preferred approach to a task and it
assumes you will be taking that approach
You can almost always choose to do things the non-
Rails way
However, this will not be as easy
The path of least pain is definitely to do things the Rails
way whenever possible
66. Convention Over
Configuration
Rails has considerably less configuration files than
many other Web frameworks
Instead of always asking, Rails will assume you are
following conventions (no configuration needed)
67. Convention Over
Configuration
Rails has considerably less configuration files than
many other Web frameworks
Instead of always asking, Rails will assume you are
following conventions (no configuration needed)
This makes following the conventions easy
68. Convention Over
Configuration
Rails has considerably less configuration files than
many other Web frameworks
Instead of always asking, Rails will assume you are
following conventions (no configuration needed)
This makes following the conventions easy
If you need to break conventions, things will be less
easy
77. Rails Cares How You Code
DRY
Don’t Repeat Yourself
Rails has tools to help you avoid repeating code
78. Rails Cares How You Code
DRY
Don’t Repeat Yourself
Rails has tools to help you avoid repeating code
YAGNI
79. Rails Cares How You Code
DRY
Don’t Repeat Yourself
Rails has tools to help you avoid repeating code
YAGNI
You Ain’t Gonna Need It
80. Rails Cares How You Code
DRY
Don’t Repeat Yourself
Rails has tools to help you avoid repeating code
YAGNI
You Ain’t Gonna Need It
Rails is agile and can help you change as needed
81. Rails Cares How You Code
DRY
Don’t Repeat Yourself
Rails has tools to help you avoid repeating code
YAGNI
You Ain’t Gonna Need It
Rails is agile and can help you change as needed
Rails encourages TDD (Test Driven Development)
82. The Anatomy
of a Rails Project
Let’s take a first look at how Rails prefers to
keep its house
84. Starting a Rails Project
$ rails -d sqlite3 my_project
Ask Rails to create create
create app/controllers
things for you, so it can create app/helpers
create app/models
do it the way it prefers create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
…
85. Starting a Rails Project
$ rails -d sqlite3 my_project
Ask Rails to create create
create app/controllers
things for you, so it can create app/helpers
create app/models
do it the way it prefers create app/views/layouts
create config/environments
create config/initializers
create config/locales
To start a project, just create db
create doc
name it create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
…
86. Starting a Rails Project
$ rails -d sqlite3 my_project
Ask Rails to create create
create app/controllers
things for you, so it can create app/helpers
create app/models
do it the way it prefers create app/views/layouts
create config/environments
create config/initializers
create config/locales
To start a project, just create db
create doc
name it create lib
create lib/tasks
create log
Optionally, you can create public/images
create public/javascripts
create public/stylesheets
choose a database create script/performance
create test/fixtures
create test/functional
create test/integration
…
87. Starting a Rails Project
$ rails -d sqlite3 my_project
Ask Rails to create create
create app/controllers
things for you, so it can create app/helpers
create app/models
do it the way it prefers create app/views/layouts
create config/environments
create config/initializers
create config/locales
To start a project, just create db
create doc
name it create lib
create lib/tasks
create log
Optionally, you can create public/images
create public/javascripts
create public/stylesheets
choose a database create script/performance
create test/fixtures
create test/functional
SQLite is simple create test/integration
…
93. The lib/ and
vendor/ Directories
lib/ is for library code
shared by your entire
application
94. The lib/ and
vendor/ Directories
lib/ is for library code
shared by your entire
application
It also holds
maintenance tasks
95. The lib/ and
vendor/ Directories
lib/ is for library code
shared by your entire
application
It also holds
maintenance tasks
vendor/ is for third
party extensions
(“gems”) or plugins
97. The test/ Directory
Rails encourages you
to test your application
on multiple levels
98. The test/ Directory
Rails encourages you
to test your application
on multiple levels
It also provides tools
for loading test data
and doing performance
testing
110. # SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
config/database.yml
Rails configures a different database
for each environment
111. # SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
config/database.yml
Rails configures a different database
for each environment
118. The Rakefile and
script/ Directory
Rails has scripts for:
Creating new models
and controllers
119. The Rakefile and
script/ Directory
Rails has scripts for:
Creating new models
and controllers
Interactively working
with your models
120. The Rakefile and
script/ Directory
Rails has scripts for:
Creating new models
and controllers
Interactively working
with your models
Installing plugins
121. The Rakefile and
script/ Directory
Rails has scripts for:
Creating new models
and controllers
Interactively working
with your models
Installing plugins
Running your code
122. The Rakefile and
script/ Directory
Rails has scripts for:
Creating new models
and controllers
Interactively working
with your models
Installing plugins
Running your code
Maintenance tasks
124. $ cd my_project
$ script/server
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
script/server
Launching your Rails application is as simple as
triggering the server script
125. $ cd my_project
$ script/server
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
script/server
Launching your Rails application is as simple as
triggering the server script
126. Rails Up and Running
Browse to http://localhost:3000/
to see your application running