SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
DEFAULT DIRECTORY STRUCTURE

rails_root
app
apis
controllers
application.rb
helpers
application_helper.rb
models

Methods
Strings
capitalize!
center
chomp!
chop!
concat
count
crypt
delete!
downcase!
dump
each
each_byte
empty?
gsub!
hash
hex
include?
index
intern
length
ljust, rjust
next!
oct
replace
reverse!
rindex
scan
slice!
split
squeeze!
strip!
sub!
sum
swapcase!
tr!
tr_s!
unpack
upcase!
upto
Regex
escape
last_match
new
quote
casefold?
kcode
match
source
Time
asctime
ctime
day
gmt?
gmtime
hour
isdst
localtime
mday
min
mon
month
sec
strftime
tv_sec
tv_usec
usec
utc
utc?
wday
yday
year
zone

views
layouts
components
config

Methods

PRE-DEFINED VARIABLES

$!

Exception information

$&

String of last match

$`

String left of last match

$'

String right of last match

$+

Last group of last match

$N

Nth group of last match

$=

Case insensitive flag

$/

Input record separator

$

Output record separator

$,

Output field separator

$.

Current line number of
last file read

test.rb
database.yml
environment.rb
routes.rb
db
doc
lib
log
development.log

Name of script

$*

Command line arguments

$stderr

Standard error output

$stdin

Standard input

$stdout

Standard output

$-a

True if -a is set.
Status of -d switch
True if -l is set

$-p

production.rb

Last input line of string

$0

$-l

development.rb

Default output for print

$_

$-d

environments

$>

True if -p is set

$-v

Verbose Flag

production.log
server.log
test.log
public
images
javascripts
controls.js
dragdrop.js
effects.js
prototype.js
stylesheets
.htaccess
404.html
500.html
dispatch.cgi
dispatch.fcgi
dispatch.rb
favicon.ico
index.html
script

RESERVED WORDS

=begin

elsif

rescue

=end

end

retry

BEGIN

ensure

return

END

false

self

alias

for

super

and

if

then

begin

in

true

break

module

undef

case

next

unless

class

nil

until

def

not

when

defined?

or

while

do

redo

yield

else
REGULAR EXPRESSIONS SYNTAX
^

fixtures
functional
mocks
development
test
unit
test_helper.rb
vendor

METHODS NOTE
! - Denotes where a tailing ! may be
! - used. A colourless ! denotes that the
! - ! is compulsory.

Start of string

$

End of string

.

Any single character

(a|b)

a or b

(...)

Group section

[abc]

Item in range (a or b or c)

[^abc]

Not in range (not a or b or c)

a?

Zero or one of a

a*

Zero or more of a

a+

One or more of a

a{3}

test

Exactly 3 of a

a{3,}

3 or more of a

a{3,6}

Between 3 and 6 of a
!(pattern) "Not" prefix. Apply rule when
URL does not match pattern.

Arrays
assoc
at
clear
collect!
compact!
concat
delete
delete_at
delete_if
each
each_index
empty?
eql?
fill
first
flatten!
include?
index
indexes
join
last
length
nitems
pack
pop
push
rassoc
reject!
replace
reverse!
reverse_each
rindex
shift
slice!
sort!
uniq!
unshift

Validation
condition_block?
create!
evaluate_condition
validate
validate_on_create
validate_on_update
validates_acceptance_of
validates_associated
validates_confirmation_of
validates_each
validates_exclusion_of
validates_format_of
validates_inclusion_of
validates_length_of
validates_numericality_of
validates_presence_of
validates_size_of
validates_uniqueness_of
Enumerable Mixin
collect
each_with_index
entries
find
find_all
grep
include?
max
min
reject
sort
Available free from
AddedBytes.com
Ruby on Rails Logo
used with permission.

Más contenido relacionado

Ähnlich wie Ruby on-rails-cheat-sheet-v1

How to use Parquet as a basis for ETL and analytics
How to use Parquet as a basis for ETL and analyticsHow to use Parquet as a basis for ETL and analytics
How to use Parquet as a basis for ETL and analyticsJulien Le Dem
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandrarantav
 
New features in abap
New features in abapNew features in abap
New features in abapSrihari J
 
Types Don't Know #, Howard Hinnant - CppCon 2014
Types Don't Know #, Howard Hinnant - CppCon 2014Types Don't Know #, Howard Hinnant - CppCon 2014
Types Don't Know #, Howard Hinnant - CppCon 2014Ripple Labs
 
Regular expressions in Python
Regular expressions in PythonRegular expressions in Python
Regular expressions in PythonSujith Kumar
 
Crack the interview
Crack the interviewCrack the interview
Crack the interviewPratik Patel
 
Regular Expression (RegExp)
Regular Expression (RegExp)Regular Expression (RegExp)
Regular Expression (RegExp)Davide Dell'Erba
 
priya-pldi-2015.pdf
priya-pldi-2015.pdfpriya-pldi-2015.pdf
priya-pldi-2015.pdfFenilVadher
 
20170516 hug france-warp10-time-seriesanalysisontopofhadoop
20170516 hug france-warp10-time-seriesanalysisontopofhadoop20170516 hug france-warp10-time-seriesanalysisontopofhadoop
20170516 hug france-warp10-time-seriesanalysisontopofhadoopMathias Herberts
 
Mixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsMixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsScott Fraundorf
 
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARDTia Ricci
 
Perl at SkyCon'12
Perl at SkyCon'12Perl at SkyCon'12
Perl at SkyCon'12Tim Bunce
 
Unitiv 111206005201-phpapp01
Unitiv 111206005201-phpapp01Unitiv 111206005201-phpapp01
Unitiv 111206005201-phpapp01riddhi viradiya
 
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichCreating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichWillem van Ketwich
 
Faster persistent data structures through hashing
Faster persistent data structures through hashingFaster persistent data structures through hashing
Faster persistent data structures through hashingJohan Tibell
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout source{d}
 
So You Want to Write a Connector?
So You Want to Write a Connector? So You Want to Write a Connector?
So You Want to Write a Connector? confluent
 
Objectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdfObjectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdffcsondhiindia
 

Ähnlich wie Ruby on-rails-cheat-sheet-v1 (20)

Ruby on rails_cheat_sheet
Ruby on rails_cheat_sheetRuby on rails_cheat_sheet
Ruby on rails_cheat_sheet
 
How to use Parquet as a basis for ETL and analytics
How to use Parquet as a basis for ETL and analyticsHow to use Parquet as a basis for ETL and analytics
How to use Parquet as a basis for ETL and analytics
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
 
New features in abap
New features in abapNew features in abap
New features in abap
 
Types Don't Know #, Howard Hinnant - CppCon 2014
Types Don't Know #, Howard Hinnant - CppCon 2014Types Don't Know #, Howard Hinnant - CppCon 2014
Types Don't Know #, Howard Hinnant - CppCon 2014
 
Regular expressions in Python
Regular expressions in PythonRegular expressions in Python
Regular expressions in Python
 
Crack the interview
Crack the interviewCrack the interview
Crack the interview
 
Regular Expression (RegExp)
Regular Expression (RegExp)Regular Expression (RegExp)
Regular Expression (RegExp)
 
priya-pldi-2015.pdf
priya-pldi-2015.pdfpriya-pldi-2015.pdf
priya-pldi-2015.pdf
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
20170516 hug france-warp10-time-seriesanalysisontopofhadoop
20170516 hug france-warp10-time-seriesanalysisontopofhadoop20170516 hug france-warp10-time-seriesanalysisontopofhadoop
20170516 hug france-warp10-time-seriesanalysisontopofhadoop
 
Mixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsMixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive Statistics
 
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARD
 
Perl at SkyCon'12
Perl at SkyCon'12Perl at SkyCon'12
Perl at SkyCon'12
 
Unitiv 111206005201-phpapp01
Unitiv 111206005201-phpapp01Unitiv 111206005201-phpapp01
Unitiv 111206005201-phpapp01
 
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichCreating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
 
Faster persistent data structures through hashing
Faster persistent data structures through hashingFaster persistent data structures through hashing
Faster persistent data structures through hashing
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
 
So You Want to Write a Connector?
So You Want to Write a Connector? So You Want to Write a Connector?
So You Want to Write a Connector?
 
Objectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdfObjectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdf
 

Último

Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTopCSSGallery
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Alkin Tezuysal
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNeo4j
 
Technical SEO for Improved Accessibility WTS FEST
Technical SEO for Improved Accessibility  WTS FESTTechnical SEO for Improved Accessibility  WTS FEST
Technical SEO for Improved Accessibility WTS FESTBillieHyde
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024Brian Pichman
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0DanBrown980551
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsDianaGray10
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxSatishbabu Gunukula
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfInfopole1
 
IT Service Management (ITSM) Best Practices for Advanced Computing
IT Service Management (ITSM) Best Practices for Advanced ComputingIT Service Management (ITSM) Best Practices for Advanced Computing
IT Service Management (ITSM) Best Practices for Advanced ComputingMAGNIntelligence
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and businessFrancesco Corti
 
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxGraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxNeo4j
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingFrancesco Corti
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTxtailishbaloch
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdfThe Good Food Institute
 
The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)codyslingerland1
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kitJamie (Taka) Wang
 
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES LiveKeep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES LiveIES VE
 

Último (20)

Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4j
 
Technical SEO for Improved Accessibility WTS FEST
Technical SEO for Improved Accessibility  WTS FESTTechnical SEO for Improved Accessibility  WTS FEST
Technical SEO for Improved Accessibility WTS FEST
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptx
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
 
IT Service Management (ITSM) Best Practices for Advanced Computing
IT Service Management (ITSM) Best Practices for Advanced ComputingIT Service Management (ITSM) Best Practices for Advanced Computing
IT Service Management (ITSM) Best Practices for Advanced Computing
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and business
 
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxGraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is going
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf
 
The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kit
 
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES LiveKeep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
 

Ruby on-rails-cheat-sheet-v1

  • 1. DEFAULT DIRECTORY STRUCTURE rails_root app apis controllers application.rb helpers application_helper.rb models Methods Strings capitalize! center chomp! chop! concat count crypt delete! downcase! dump each each_byte empty? gsub! hash hex include? index intern length ljust, rjust next! oct replace reverse! rindex scan slice! split squeeze! strip! sub! sum swapcase! tr! tr_s! unpack upcase! upto Regex escape last_match new quote casefold? kcode match source Time asctime ctime day gmt? gmtime hour isdst localtime mday min mon month sec strftime tv_sec tv_usec usec utc utc? wday yday year zone views layouts components config Methods PRE-DEFINED VARIABLES $! Exception information $& String of last match $` String left of last match $' String right of last match $+ Last group of last match $N Nth group of last match $= Case insensitive flag $/ Input record separator $ Output record separator $, Output field separator $. Current line number of last file read test.rb database.yml environment.rb routes.rb db doc lib log development.log Name of script $* Command line arguments $stderr Standard error output $stdin Standard input $stdout Standard output $-a True if -a is set. Status of -d switch True if -l is set $-p production.rb Last input line of string $0 $-l development.rb Default output for print $_ $-d environments $> True if -p is set $-v Verbose Flag production.log server.log test.log public images javascripts controls.js dragdrop.js effects.js prototype.js stylesheets .htaccess 404.html 500.html dispatch.cgi dispatch.fcgi dispatch.rb favicon.ico index.html script RESERVED WORDS =begin elsif rescue =end end retry BEGIN ensure return END false self alias for super and if then begin in true break module undef case next unless class nil until def not when defined? or while do redo yield else REGULAR EXPRESSIONS SYNTAX ^ fixtures functional mocks development test unit test_helper.rb vendor METHODS NOTE ! - Denotes where a tailing ! may be ! - used. A colourless ! denotes that the ! - ! is compulsory. Start of string $ End of string . Any single character (a|b) a or b (...) Group section [abc] Item in range (a or b or c) [^abc] Not in range (not a or b or c) a? Zero or one of a a* Zero or more of a a+ One or more of a a{3} test Exactly 3 of a a{3,} 3 or more of a a{3,6} Between 3 and 6 of a !(pattern) "Not" prefix. Apply rule when URL does not match pattern. Arrays assoc at clear collect! compact! concat delete delete_at delete_if each each_index empty? eql? fill first flatten! include? index indexes join last length nitems pack pop push rassoc reject! replace reverse! reverse_each rindex shift slice! sort! uniq! unshift Validation condition_block? create! evaluate_condition validate validate_on_create validate_on_update validates_acceptance_of validates_associated validates_confirmation_of validates_each validates_exclusion_of validates_format_of validates_inclusion_of validates_length_of validates_numericality_of validates_presence_of validates_size_of validates_uniqueness_of Enumerable Mixin collect each_with_index entries find find_all grep include? max min reject sort Available free from AddedBytes.com Ruby on Rails Logo used with permission.