ݺߣ

ݺߣShare a Scribd company logo
1
2
3
4
5
6
7
app/
                                                controllers
                                (2)
                con?g/
               routes.rb

       (1)                                                          (3)
                                      (5)                     (4)

User
         (6)


                                                                    app/models
                    app/views




                                            8
9
10
11
class You
  def self.hello     You.hello # hello
   puts hello      you = You.new
  end                you.hello # error
                     you.morning # morning
  def morning
   puts morning
  end
end



                    12
a = 120
a = 100             if a == 100
if a == 100           puts "100!"
  puts "100!"       elsif a == 120
else                  puts "120!"
  puts "not 100!"   else
end                   puts ?
                    end




                    13
list = [1,2,3]           list = [1,2,3]
list.each do |it|        list.each { |it|
  puts it                  puts it
end                      }




                    14
"a".twice # error   class You
                      private
class String          def secret
  def twice            puts sleeping
   self + self        end
  end               end
end                 you = You.new
                    you.secret # error
"a".twice # => "aa' you.send(:secret) # =>
                    sleeping

                      15
16
17
class BlogsController
  def index # <=
 end
 def edit
 end
end


                        18
class Blog < ActiveRecord::Base
end




                     19
app/views/blogs/{action}.html.erb



app/views/layouts/blogs.html.erb
or
app/views/layouts/application.html.erb


                   20
<%= 100 %>

<% if a == 100 %>
<div>Hello!</div>
<% end %>

<%# comment %>


                    21
<%= render 'form' %>
_form.html.erb




                 22
class BlogsController
  def index # <=         <% @list.each do |it| %>
                         <div><%= it %></div>
  @list = [1,2,3]        <% end %>
   @list.pop
 end
 def edit
 end
end




                        23
24
>> entry = Blog.?rst

>> entry.title

>> entry.title = heeeelp
>> entry.save



                       25
class Blog < ActiveRecord::Base
end
                        class CreateBlogs < ActiveRecord::Migration
                          def self.up
>> entry = Blog.?rst       create_table :blogs do |t|
>> entry.title               t.string :title
                             t.text :body

                            t.timestamps
                          end
                         end
                        end




                       26

More Related Content

What's hot (20)

Silex: From nothing to an API
Silex: From nothing to an APISilex: From nothing to an API
Silex: From nothing to an API
chrisdkemper
?
Complex Sites with Silex
Complex Sites with SilexComplex Sites with Silex
Complex Sites with Silex
Chris Tankersley
?
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel16.mysql stored procedures in laravel
16.mysql stored procedures in laravel
Razvan Raducanu, PhD
?
Les exceptions, oui, mais pas n'importe comment
Les exceptions, oui, mais pas n'importe commentLes exceptions, oui, mais pas n'importe comment
Les exceptions, oui, mais pas n'importe comment
Charles Desneuf
?
Ť´귽
Ť´귽Ť´귽
Ť´귽
techmemo
?
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
Yehuda Katz
?
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application framework
techmemo
?
TYPO3 Flow 2.0 (T3CON13 San Francisco)
TYPO3 Flow 2.0 (T3CON13 San Francisco)TYPO3 Flow 2.0 (T3CON13 San Francisco)
TYPO3 Flow 2.0 (T3CON13 San Francisco)
Robert Lemke
?
Awash in a sea of connections
Awash in a sea of connectionsAwash in a sea of connections
Awash in a sea of connections
Galen Charlton
?
The Symfony CLI
The Symfony CLIThe Symfony CLI
The Symfony CLI
Sarah El-Atm
?
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
wpnepal
?
ZCPE - PHP Conference 2015
ZCPE   - PHP Conference 2015ZCPE   - PHP Conference 2015
ZCPE - PHP Conference 2015
Matheus Marabesi
?
Be happy with Ruby on Rails - CEUNSP Itu
Be happy with Ruby on Rails - CEUNSP ItuBe happy with Ruby on Rails - CEUNSP Itu
Be happy with Ruby on Rails - CEUNSP Itu
Lucas Renan
?
TDC 2016 (Florianpolis) - V para o prximo nvel - Dicas e truques para a c...
TDC 2016 (Florianpolis) - V para o prximo nvel - Dicas e truques para a c...TDC 2016 (Florianpolis) - V para o prximo nvel - Dicas e truques para a c...
TDC 2016 (Florianpolis) - V para o prximo nvel - Dicas e truques para a c...
Matheus Marabesi
?
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For KohaPutting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Galen Charlton
?
Laravel Design Patterns
Laravel Design PatternsLaravel Design Patterns
Laravel Design Patterns
Bobby Bouwmann
?
Generating Power with Yield
Generating Power with YieldGenerating Power with Yield
Generating Power with Yield
Jason Myers
?
Limited return type covariance and argument type contravariance
Limited return type covariance and argument type contravarianceLimited return type covariance and argument type contravariance
Limited return type covariance and argument type contravariance
nob f
?
Getting out of Callback Hell in PHP
Getting out of Callback Hell in PHPGetting out of Callback Hell in PHP
Getting out of Callback Hell in PHP
Arul Kumaran
?
Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)
Dave Hulbert
?
Silex: From nothing to an API
Silex: From nothing to an APISilex: From nothing to an API
Silex: From nothing to an API
chrisdkemper
?
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel16.mysql stored procedures in laravel
16.mysql stored procedures in laravel
Razvan Raducanu, PhD
?
Les exceptions, oui, mais pas n'importe comment
Les exceptions, oui, mais pas n'importe commentLes exceptions, oui, mais pas n'importe comment
Les exceptions, oui, mais pas n'importe comment
Charles Desneuf
?
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application framework
techmemo
?
TYPO3 Flow 2.0 (T3CON13 San Francisco)
TYPO3 Flow 2.0 (T3CON13 San Francisco)TYPO3 Flow 2.0 (T3CON13 San Francisco)
TYPO3 Flow 2.0 (T3CON13 San Francisco)
Robert Lemke
?
Awash in a sea of connections
Awash in a sea of connectionsAwash in a sea of connections
Awash in a sea of connections
Galen Charlton
?
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
wpnepal
?
Be happy with Ruby on Rails - CEUNSP Itu
Be happy with Ruby on Rails - CEUNSP ItuBe happy with Ruby on Rails - CEUNSP Itu
Be happy with Ruby on Rails - CEUNSP Itu
Lucas Renan
?
TDC 2016 (Florianpolis) - V para o prximo nvel - Dicas e truques para a c...
TDC 2016 (Florianpolis) - V para o prximo nvel - Dicas e truques para a c...TDC 2016 (Florianpolis) - V para o prximo nvel - Dicas e truques para a c...
TDC 2016 (Florianpolis) - V para o prximo nvel - Dicas e truques para a c...
Matheus Marabesi
?
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For KohaPutting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha
Galen Charlton
?
Generating Power with Yield
Generating Power with YieldGenerating Power with Yield
Generating Power with Yield
Jason Myers
?
Limited return type covariance and argument type contravariance
Limited return type covariance and argument type contravarianceLimited return type covariance and argument type contravariance
Limited return type covariance and argument type contravariance
nob f
?
Getting out of Callback Hell in PHP
Getting out of Callback Hell in PHPGetting out of Callback Hell in PHP
Getting out of Callback Hell in PHP
Arul Kumaran
?
Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)
Dave Hulbert
?

Similar to 鲹3ϥ󥺥 (20)

Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11
Pedro Cunha
?
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
bryanbibat
?
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
rstankov
?
Why ruby
Why rubyWhy ruby
Why ruby
rstankov
?
Migrating legacy data
Migrating legacy dataMigrating legacy data
Migrating legacy data
Patrick Huesler
?
Ruby
RubyRuby
Ruby
Kerry Buckley
?
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Cox
lachie
?
Simple restfull app_s
Simple restfull app_sSimple restfull app_s
Simple restfull app_s
netwix
?
Rails best practices_slides
Rails best practices_slidesRails best practices_slides
Rails best practices_slides
Cao Van An
?
Say Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick SuttererSay Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick Sutterer
Ruby Meditation
?
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
F
?
Module Magic
Module MagicModule Magic
Module Magic
James Gray
?
Rails workshop for Java people (September 2015)
Rails workshop for Java people (September 2015)Rails workshop for Java people (September 2015)
Rails workshop for Java people (September 2015)
Andre Foeken
?
Tres Gemas De Ruby
Tres Gemas De RubyTres Gemas De Ruby
Tres Gemas De Ruby
Leonardo Soto
?
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code styleRuby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Anton Shemerey
?
Ruby Intro {spection}
Ruby Intro {spection}Ruby Intro {spection}
Ruby Intro {spection}
Christian KAKESA
?
Ruby Metaprogramming
Ruby MetaprogrammingRuby Metaprogramming
Ruby Metaprogramming
Thaichor Seng
?
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby
Wes Oldenbeuving
?
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
Daniel Cukier
?
Ruby on Rails ƥåץåv -
Ruby on Rails ƥåץåv - Ruby on Rails ƥåץåv -
Ruby on Rails ƥåץåv -
Yasuko Ohba
?
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11
Pedro Cunha
?
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Cox
lachie
?
Simple restfull app_s
Simple restfull app_sSimple restfull app_s
Simple restfull app_s
netwix
?
Rails best practices_slides
Rails best practices_slidesRails best practices_slides
Rails best practices_slides
Cao Van An
?
Say Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick SuttererSay Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick Sutterer
Ruby Meditation
?
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
F
?
Rails workshop for Java people (September 2015)
Rails workshop for Java people (September 2015)Rails workshop for Java people (September 2015)
Rails workshop for Java people (September 2015)
Andre Foeken
?
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code styleRuby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Anton Shemerey
?
Ruby on Rails ƥåץåv -
Ruby on Rails ƥåץåv - Ruby on Rails ƥåץåv -
Ruby on Rails ƥåץåv -
Yasuko Ohba
?

More from Shinsaku Chikura (9)

?`ˤ¥ȥ? ±g`?󥽩` Cafeˮײ?å ?
?`ˤ¥ȥ? ±g`?󥽩` Cafeˮײ?å ??`ˤ¥ȥ? ±g`?󥽩` Cafeˮײ?å ?
?`ˤ¥ȥ? ±g`?󥽩` Cafeˮײ?å ?
Shinsaku Chikura
?
WebPay on Rails
WebPay on RailsWebPay on Rails
WebPay on Rails
Shinsaku Chikura
?
֥饤Ƥߤ褦
֥饤Ƥߤ褦֥饤Ƥߤ褦
֥饤Ƥߤ褦
Shinsaku Chikura
?
`ץ󥽩`ǎڤ󲹳Ǵǰ쥢ץ
`ץ󥽩`ǎڤ󲹳Ǵǰ쥢ץ`ץ󥽩`ǎڤ󲹳Ǵǰ쥢ץ
`ץ󥽩`ǎڤ󲹳Ǵǰ쥢ץ
Shinsaku Chikura
?
FacebootstrapFacebootstrap
Facebootstrap
Shinsaku Chikura
?
Jump into Rails3
Jump into Rails3Jump into Rails3
Jump into Rails3
Shinsaku Chikura
?
⤫鿼鲹
⤫鿼鲹⤫鿼鲹
⤫鿼鲹
Shinsaku Chikura
?

鲹3ϥ󥺥

Editor's Notes