Upgrade to Pro — share decks privately, control downloads, hide ads and more …

working with rails console

working with rails console

#ROROSyd presentation - 13-09-16

Avatar for Sameera (Sam)

Sameera (Sam)

September 13, 2016

More Decks by Sameera (Sam)

Other Decks in Programming

Transcript

  1. COMMAND AUTO COMPLETE U s e r . w [

    T A B ] # = > U s e r . w h e r e U s e r . w i t h _ o p t i o n s U s e r . w i t h _ w a r n i n g s
  2. RAILS HELPERS h e l p e r . t

    i m e _ a g o _ i n _ w o r d s ( T i m e . n o w ) # = > " l e s s t h a n a m i n u t e " h e l p e r . n u m b e r _ t o _ c u r r e n c y ( 1 . 5 0 ) # = > " $ 1 . 5 0 "
  3. ROUTES & HTTP REQUESTS a p p . u s

    e r s _ p a t h # = > " / u s e r s " a p p . g e t a p p . u s e r s _ p a t h # = > " 2 0 0 "
  4. USING FACTORIES TO POPULATE DATA * if you have factorygirl

    setup F a c t o r y G i r l . c r e a t e : u s e r
  5. CHECKING THE METHOD LOCATION U s e r . i

    n s t a n c e _ m e t h o d ( : f u l l _ n a m e ) . s o u r c e _ l o c a t i o n # = > [ " . . / a p p / m o d e l s / u s e r . r b " , 2 ]
  6. RAILS SANDBOX r a i l s c o n

    s o l e - - s a n d b o x
  7. LOCADING RAILS CONSOLE IN DIFFERENT ENVIRONMENTS r a i l

    s c o n s o l e [ e n v i r o n m e n t ] E . g r a i l s c o n s o l e p r o d u c t i o n # = > L o a d i n g p r o d u c t i o n e n v i r o n m e n t ( R a i l s
  8. USEFULL LINKS (pretty much the whole presentation) SO console shortcuts

    tips tricks three quick rails console tips rails guides